本文整理汇总了PHP中SoapClient::__getTypes方法的典型用法代码示例。如果您正苦于以下问题:PHP SoapClient::__getTypes方法的具体用法?PHP SoapClient::__getTypes怎么用?PHP SoapClient::__getTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoapClient
的用法示例。
在下文中一共展示了SoapClient::__getTypes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* generate model files
*/
public function run()
{
foreach ($this->soapClient->__getTypes() as $t) {
$typeContent = $this->getTypeContent($t);
if (is_array($typeContent) && isset($typeContent['content'])) {
$file = SOAP_OUTPUT_BASE_DIR . '/' . SOAP_MODEL_DIR . '/' . $typeContent['class'] . '.class.php';
if (file_put_contents($file, $typeContent['content']) === false) {
$this->logger->err('can not write file ' . $file . ' check if permissions are correct.');
} else {
$this->logger->debug('write new model file: ' . $file);
}
}
}
}
示例2: index
/**
* 首页
*/
public function index()
{
if (!class_exists("SoapClient")) {
exit("请开启Soap扩展!");
}
$ws = "http://www.webservicex.net/globalweather.asmx?wsdl";
//webservice服务的地址
$ws = "http://122.224.230.4:18003/newyorkWS/ws/CheckGoodsDecl?wsdl";
// $ws = "http://122.224.230.4:18003/newyorkWS/ws/ReceivedDeclare?wsdl";
$client = new \SoapClient($ws);
/*
* 获取SoapClient对象引用的服务所提供的所有方法
*/
echo "SOAP服务器提供的开放函数:";
echo '<pre>';
var_dump($client->__getFunctions());
//获取服务器上提供的方法
echo '</pre>';
echo "SOAP服务器提供的Type:";
echo '<pre>';
var_dump($client->__getTypes());
//获取服务器上数据类型
echo '</pre>';
echo "执行GetGUIDNode的结果:";
// $result=$client->checkReceived(array('xmlStr'=>'zhengzhou','xmlType'=>'IMPORT_COMPANY','sourceType'=>'1'));//查询中国郑州的天气,返回的是一个结构体
// var_dump($result);
$result = $client->check(array('companyCode' => 'zhengzhou', 'subCarriageNo' => '1'));
//查询中国郑州的天气,返回的是一个结构体
dump(simplexml_load_string($result->return));
// $this->display();
// echo $result->return;
exit;
}
示例3: checkSoapClient
private function checkSoapClient()
{
try {
$defaultTimeout = ini_get("default_socket_timeout");
ini_set("default_socket_timeout", 15);
$soapClient = new \SoapClient($this->getWSDLUrl());
$this->aMethods = $soapClient->__getFunctions();
$this->aTypes = $soapClient->__getTypes();
$this->setEstado(true);
} catch (SoapFault $f) {
$mensajeError = '';
$msg = $f->faultstring;
if (strstr($msg, 'failed to load external entity')) {
$mensajeError = 'Error de conexión - ';
} else {
if ($f->faultcode == 'HTTP' && strstr(strtolower($f->faultstring), 'error fetching http headers')) {
$mensajeError = 'Tiempo de espera superado - ';
}
}
$mensajeError .= $msg;
$this->setEstado(false);
$this->setMensaje($mensajeError);
}
ini_set("default_socket_timeout", $defaultTimeout);
return $this->getEstado();
}
示例4: createFromClient
/**
* Возвращает экземпляр Resolver на основе переданного SOAP клиента
*
* @param \SoapClient $client Клиент
*
* @return Resolver
*/
public static function createFromClient(\SoapClient $client)
{
$functions = $client->__getFunctions();
$types = $client->__getTypes();
$functionParser = new FunctionParser($functions);
$typeParser = new TypeParser($types);
return new Resolver($functionParser->getFunctions(), $typeParser->getTypes());
}
示例5: getTypes
/**
* Return a list of SOAP types
*
* @return array
* @throws Zend_Soap_Client_Exception
*/
public function getTypes()
{
if ($this->getWsdl() == null) {
throw new Zend_Soap_Client_Exception('\'getTypes\' method is available only in WSDL mode.');
}
if ($this->_soapClient == null) {
$this->_initSoapClientObject();
}
return $this->_soapClient->__getTypes();
}
示例6: SoapClient
function __construct($wsdlurl)
{
$client = new SoapClient($wsdlurl);
$functions = $client->__getFunctions();
$typeStrings = $client->__getTypes();
$types = array();
foreach ($typeStrings as $t) {
$types = $types + $this->extractParameterInfo($t);
}
$this->types = $types;
$operations = array();
foreach ($functions as $f) {
$operation = $this->extractFunctionInfo($types, $f);
$key = $operation->toString();
if (!array_key_exists($key, $operations)) {
$operations[$key] = $operation;
}
}
$this->operations = $operations;
// var_dump($client->);
// echo "<br />";
}
示例7: __getTypes
/**
* @link http://php.net/manual/en/soapclient.gettypes.php
*
* @return array
*/
public function __getTypes()
{
return parent::__getTypes();
}
示例8: fun_NWMLS_getSoapInfo
/**
* figure out what soap functions and types are available
* @param object $client Soap Client
* @returns string $Response soap result
*/
public function fun_NWMLS_getSoapInfo()
{
$WSDL = $this->WSDL;
$client = new SoapClient($WSDL, array('trace' => 1));
//trace for getLastResponse();
//debug (and figuring out what to do!)
//get functions and params
var_dump($client->__getFunctions());
var_dump($client->__getTypes());
$Response = $client->__getLastResponse();
echo "\n\n\n";
echo "Response:{$Response}\n";
echo "\n\n\n";
//debug
//echo "REQUEST:\n" . $client->__getLastRequest() . "\n"; //Shows query just sent
//echo "RESPONSE:\n" . $client->__getLastResponse() . "\n"; //gets the data
return $Response;
}
示例9: catch
echo "<td>";
echo "<pre>" . print_r($client->__getFunctions(), true) . "</pre>";
echo "</td>";
echo "</tr>";
echo "</tbody>";
echo "</table>";
echo "<table>";
echo "<thead>";
echo "<tr align='left'>";
echo "<th>__getTypes()</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
echo "<tr>";
echo "<td>";
echo "<pre>" . print_r($client->__getTypes(), true) . "</pre>";
echo "</td>";
echo "</tr>";
echo "</tbody>";
echo "</table>";
} catch (SoapFault $fault) {
echo "<table>";
echo "<thead>";
echo "<tr>";
echo "<th>SOAP Fault</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
echo "<tr>";
echo "<td>";
echo "<pre>";
示例10: SoapClient
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
ini_set('soap.wsdl_cache_enabled', '0');
//关闭缓存
$soap = new SoapClient('http://wl.com/api.php/soap/op/api');
echo "提供的方法\n";
print_r($soap->__getFunctions());
echo "相关的数据结构\n";
print_r($soap->__getTypes());
var_dump($soap->receive(array('arg0' => file_get_contents(SITE_ROOT . 'YUN.xml')))->return);
示例11: var_dump
<?php
ini_set("soap.wsdl_cache_enabled", "0");
$myClient = new SoapClient("http://rtls.gg/ws/wsdl.php");
foreach ($myClient->__getFunctions() as $item) {
echo $item . "<br>";
}
echo "<hr>";
foreach ($myClient->__getTypes() as $item) {
echo $item . "<br>";
}
echo "<hr>";
echo var_dump($myClient->getPeople());
/*
foreach($myClient->getPeople() as $item) {
echo $item->getFullName();
}
*/
示例12: SoapClient
<?php
//load the wsdl file
$client = new SoapClient("http://example.com/soap/definition.wsdl");
//functions are now available to be called
$result = $client->soapFunc("hello");
$result = $client->anotherSoapFunc(34234);
//SOAP Information
$client = new SoapClient("http://example.com/soap/definition.wsdl");
//list of SOAP types
print_r($client->__getTypes());
//list if SOAP Functions
print_r($client->__getFunctions());
示例13: __construct
/**
* Instantiate service, set SOAP header with credentials
*
* @param string $wsdl Path to WSDL
* @param string $username Username
* @param string $password Password
*/
public function __construct($wsdl, $username, $password)
{
$params = array('encoding' => 'utf-8', 'trace' => 1, 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP);
$client = new SoapClient($wsdl, $params);
$classmap = array();
// at a high level, the following code takes a SOAP struct definition and
// translates it to valid PHP, which then gets eval()ed, so we can pass
// the resulting classes as the classmap param to the SoapClient ctor,
// which means we'll return the correct type of obj instead of stdClass.
foreach ($client->__getTypes() as $type) {
$tokens = SoapTypeTokenizer::tokenize($type);
$len = count($tokens);
$properties['classes'] = array();
$properties['other'] = array();
if ($tokens[0]['token'] !== SOAP_TYPE_STRUCT) {
continue;
}
// ignore types that aren't structs
for ($i = 0; $i < $len; ++$i) {
$code = $tokens[$i]['code'];
$token = $tokens[$i]['token'];
if ($code === SOAP_NATIVE_TYPE) {
if ($token === SOAP_TYPE_STRUCT) {
$classCode = 'class ';
$i += 2;
// skip whitespace token
$code = $tokens[$i]['code'];
$token = $tokens[$i]['token'];
// token is now the name of the struct
// add to classmap
$classmap[$token] = $token;
// if class exists (classes can be user-defined if add'l functionality is desired)
// we still want it in the classmap (above), but we don't want to re-declare it.
if (class_exists($token)) {
continue 2;
}
$classCode .= $token . ' {';
$i += 3;
// skip whitespace, semicolon tokens
} else {
// some sort of SOAP type for a property, like dateTime
// we don't care about it, we just want the name
$i += 2;
// skip whitespace token
$name = $tokens[$i]['token'];
$properties['other'][] = $name;
}
} elseif ($code === SOAP_USER_TYPE) {
// user-defined class
$i += 2;
// skip whitespace token
$name = $tokens[$i]['token'];
$properties['classes'][$name] = $token;
}
}
// property definition section
foreach ($properties['classes'] as $key => $class) {
$classCode .= 'public $' . $key . ';';
}
foreach ($properties['other'] as $class) {
$classCode .= 'public $' . $class . ';';
}
// create ctor
$classCode .= 'public function __construct(';
// populate ctor args
foreach ($properties['other'] as $key => $class) {
$classCode .= '$' . $class . ' = null,';
}
// remove extraneous trailing ',' if there
if (substr($classCode, -1, 1) === ',') {
$classCode = substr($classCode, 0, -1);
}
// close args
$classCode .= ')';
// open ctor
$classCode .= '{';
// store ctor args as class properties
foreach ($properties['other'] as $key => $class) {
$classCode .= '$this->' . $class . ' = $' . $class . ';';
}
// instantiate member properties that are classes
foreach ($properties['classes'] as $key => $class) {
$classCode .= '$this->' . $key . ' = new ' . $class . '();';
}
// close ctor
$classCode .= '}';
// close class
$classCode .= '}';
eval($classCode);
}
// create another instance of the SoapClient, this time using the classmap
$params['classmap'] = $classmap;
$this->_instance = new SoapClient($wsdl, $params);
//.........这里部分代码省略.........
示例14: SoapClient
echo '<br/>';
$client = new SoapClient("https://webportal.gtldc.net/InmatePin/InmateService.svc?wsdl");
//$client->__setLocation("https://webportal.gtldc.net/InmatePin/InmateService.svc/basic");
//$response = $client->MethodName(array( "paramName" => "paramValue" ... ));
echo 'Connection made';
echo '<br/>';
echo 'setting up security';
echo '<br/>';
try {
$availFunctions = $client->__getFunctions();
foreach ($availFunctions as $value) {
//echo $value;
//echo '<br/>';
}
echo '<br/>';
$availClass = $client->__getTypes();
foreach ($availClass as $value) {
//echo $value;
//echo '<br/>';
}
echo '<br/>';
$securityID = '';
$transID = '';
//$SOAPsecurityID = new SoapVar("Guid", "{F0ACB09E-42BC-4EFB-B73F-B2207CE47973}");
//$securityID = $client->guid("{F0ACB09E-42BC-4EFB-B73F-B2207CE47973}");
$subID = "CI01";
//$transID = $client->Guid->NewGuid();
echo 'Security setting created';
echo '<br/>';
$params = array('transID' => $transID, 'securityID' => '{F0ACB09E-42BC-4EFB-B73F-B2207CE47973}', 'inmateid' => "111111", 'subID' => $subID, 'comment' => "Test Search");
$getInfo = $client->InmateGetInfo($params);
示例15: die
<?php
if (!isset($_GET['wsdl'])) {
die("Invalid parameters");
}
// $wsdl = 'http://www.sxzkc.cn/Tools/SwfUpload/SwfUploadService.asmx?wsdl';
header('Content-Type: application/json');
try {
$wsdl = $_GET['wsdl'];
$xmldata = @file_get_contents($wsdl);
$client = new SoapClient($wsdl);
$result = array();
$data = array('init' => true);
foreach ($client->__getTypes() as $type) {
foreach (explode("\n", $type) as $line) {
if (preg_match('/struct ([^\\s]+)\\s+{/', $line, $matches)) {
if (!isset($data['init']) && !preg_match('/Response$/', $data['name'])) {
$result[] = $data;
}
$data = array('param' => array(), 'name' => $matches[1]);
} else {
if (preg_match('/\\s+([^\\s]+)\\s+([^\\s]+);/', $line, $matches)) {
$data['param'][$matches[2]] = $matches[1];
}
}
}
}
echo json_encode($result, null, 4);
} catch (Exception $e) {
echo json_encode(array());
}