SoapClient类为»SOAP 1.1和»SOAP 1.2服务器提供了一个客户端。可以在WSDL或非WSDL模式下使用。
SoapClient {
/* Methods */
public __construct ( string|null $wsdl , array $options = [] )
public __call ( string $name , array $args ) : mixed
public __doRequest ( string $request , string $location , string $action , int $version , bool $oneWay = false ) : string|null
public __getCookies ( ) : array
public __getFunctions ( ) : array|null
public __getLastRequest ( ) : string|null
public __getLastRequestHeaders ( ) : string|null
public __getLastResponse ( ) : string|null
public __getLastResponseHeaders ( ) : string|null
public __getTypes ( ) : array|null
public __setCookie ( string $name , string|null $value = null ) : void
public __setLocation ( string $location = "" ) : string|null
public __setSoapHeaders ( SoapHeader|array|null $headers = null ) : bool
public __soapCall ( string $name , array $args , array|null $options = null , SoapHeader|array|null $inputHeaders = null , array &$outputHeaders = null ) : mixed
}
SoapClient :: __ call —调用SOAP函数(不建议使用)
SoapClient :: __ construct — SoapClient构造函数
SoapClient :: __ doRequest —执行SOAP请求
SoapClient :: __ getCookies —获取cookie列表
SoapClient :: __ getFunctions —返回可用SOAP函数的列表
SoapClient :: __ getLastRequest —返回上一个SOAP请求
SoapClient :: __ getLastRequestHeaders —返回上一个请求的SOAP标头
SoapClient :: __ getLastResponse —返回上一个SOAP响应
SoapClient :: __ getLastResponseHeaders —从上次响应返回SOAP标头
SoapClient :: __ getTypes —返回SOAP类型的列表
SoapClient :: __ setCookie —为SOAP请求定义cookie
SoapClient :: __ setLocation —设置要使用的Web服务的位置
SoapClient :: __ setSoapHeaders —为后续调用设置SOAP标头
SoapClient :: __ soapCall —调用SOAP函数
function client()
{
$arrContextOptions = array("ssl" => array("verify_peer" => false, "verify_peer_name" => false, 'crypto_method' => STREAM_CRYPTO_METHOD_TLS_CLIENT));
$client = new SoapClient(dirname(__DIR__) . '/../public/cucm/AXLAPI.wsdl',
array('trace' => true,
'exceptions' => true,
'location' => env('AXL_HOST', "https://xxx.xxx.xxx.xxx:xxxx/axl/"),
'login' => env('AXL_USER', 'xxxxx'),
'password' => env('AXL_PASSWORD', 'xxxxx'),
'stream_context' => stream_context_create($arrContextOptions)
));
return $client;
}