天天看點

建立SOAP Client的options參數解釋

An array of options. If working in WSDL mode, this parameter is optional. If working in non-WSDL mode, you must set the location  and uri options, where location is the URL to request and uri is the target namespace of the SOAP service. 

$options 數組類型,如果工作在WSDL模式,該參數可選;如果工作在非WSDL模式,則必須設定location和uri,其中location為請求的URL,uri為SOAP服務的目标命名空間。

The style and use options only work in non-WSDL mode. In WSDL mode, they come from the WSDL file. 

style選項僅在非WSDL模式下起作用,在WSDL模式下該選項已在WSDL檔案中設定。

The soap_version option specifies whether to use SOAP 1.1, or SOAP 1.2 client. 

soap_version選項生命使用SOAP協定1.1或1.2版,可能的值有SOAP_1_1,SOAP_1_2。

For HTTP authentication, you may use the login and password options. For making an HTTP connection through a proxy server, use the options proxy_host, proxy_port, proxy_login and proxy_password. For HTTPS client certificate authentication use local_cert and passphrase options. 

HTTP代理選項,不用多做解釋。

The compression option allows to use compression of HTTP SOAP requests and responses. 

compression壓縮選項,該選項允許壓縮HTTP SOAP協定的請求和傳回内容,如SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP。

The encoding option defines internal character encoding. This option does not change the encoding of SOAP requests (it is always utf-8), but converts strings into it. 

encoding選項,編碼選項,utf-8、gb2312等,不用多做解釋。

The classmap option can be used to map some WSDL types to PHP classes. This option must be an array with WSDL types as keys and names of PHP classes as values. 

classmap選項,把WSDL類型映射為PHP的類,該選項必須是一個數組,把WSDL的類型作為鍵名,把PHP類名稱作為值。

Setting the boolean trace option enables use of the methods SoapClient->__getLastRequest, SoapClient->__getLastRequestHeaders, SoapClient->__getLastResponse and SoapClient->__getLastResponseHeaders.

trace選項,是否啟用調試資訊,true或false。

The exceptions option is a boolean value defining whether soap errors throw exceptions of type SoapFault. 

exceptions選項,如果有錯誤發生的時候是否抛出SoapFault類型的異常。

The connection_timeout option defines a timeout in seconds for the connection to the SOAP service. This option does not define a timeout for services with slow responses. To limit the time to wait for calls to finish the default_socket_timeout setting is available. 

connection_timeout選項,連接配接逾時,機關秒。

The typemap option is an array of type mappings. Type mapping is an array with keys type_name, type_ns (namespace URI), from_xml (callback accepting one string parameter) and to_xml (callback accepting one object parameter). 

typemap選項為類型映射數組,鍵名為類型名稱、命名空間等。

The cache_wsdl option is one of WSDL_CACHE_NONE, WSDL_CACHE_DISK, WSDL_CACHE_MEMORY or WSDL_CACHE_BOTH. 

cache_wsdl緩存選項,類型有WSDL_CACHE_NONE, WSDL_CACHE_DISK, WSDL_CACHE_MEMORY or WSDL_CACHE_BOTH。

The user_agent option specifies string to use in User-Agent header. 

user_agent選項,用戶端發送POST請求的時候在Header資訊中添加的User-Agent頭資訊。

The stream_context option is a resource for context.

The features option is a bitmask of SOAP_SINGLE_ELEMENT_ARRAYS, SOAP_USE_XSI_ARRAY_TYPE, SOAP_WAIT_ONE_WAY_CALLS.

features選項,可選的值有SOAP_SINGLE_ELEMENT_ARRAYS, SOAP_USE_XSI_ARRAY_TYPE, SOAP_WAIT_ONE_WAY_CALLS

如果遇到ArrayOf_xsd_string相關的“No deserializer defined for array type”之類的錯誤時,features=SOAP_USE_XSI_ARRAY_TYPE即可。

轉自:http://blog.csdn.net/forwardlau/article/details/3734232

記性越來越差,放到這裡

繼續閱讀