aaharu/curlsoapclient
最新稳定版本:2.0.0
Composer 安装命令:
composer require aaharu/curlsoapclient
包简介
A SoapClient wrapper that uses ext-curl.
README 文档
README
A SoapClient wrapper that uses ext-curl.
https://packagist.org/packages/aaharu/curlsoapclient
Documentation
Aaharu\Soap\CurlSoapClient::CurlSoapClient
This class is extended SoapClient.
public CurlSoapClient::CurlSoapClient ( mixed $wsdl [, array $options ] )
supported options
- soap_version
- either
SOAP_1_1orSOAP_1_2. If omitted,SOAP_1_1is used.
- either
- compression
- trace
- exceptions
- connection_timeout
- user_agent
- keep_alive
trueas a default
- login
- password
- proxy_host
- proxy_port
- proxy_login
- proxy_password
- authentication
- ssl_method
additional options
- redirect_max
- The maximum amount of HTTP redirections to follow. default is 5.
5as a default
- curl_timeout
- CURLOPT_TIMEOUT
30as a default
- proxy_type
- http, socks4, socks5
unsupported options
- stream_context
- not necessary with curl
- local_cert
- use
CurlSoapClient::___curlSetOptinstead
- use
- passphrase
- use
CurlSoapClient::___curlSetOptinstead
- use
examples
wsdl mode.
use Aaharu\Soap\CurlSoapClient; try { $client = new CurlSoapClient('http://webservices.amazon.com/AWSECommerceService/2013-08-01/AWSECommerceService.wsdl', ['trace' => true]); $client->ItemLookup(); } catch (\SoapFault $fault) { } echo $client->__getLastRequestHeaders() . $client->__getLastRequest();
POST /onca/soap?Service=AWSECommerceService HTTP/1.1
Host: webservices.amazon.com
Accept: */*
Connection: Keep-Alive
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://soap.amazon.com/ItemLookup"
Content-Length: 259
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://webservices.amazon.com/AWSECommerceService/2013-08-01"><SOAP-ENV:Body><ns1:ItemLookup/></SOAP-ENV:Body></SOAP-ENV:Envelope>
non-wsdl mode.
use Aaharu\Soap\CurlSoapClient; $client = new CurlSoapClient(null, [ 'location' => 'http://example.com/test/location', 'uri' => 'http://example.com/test/uri', 'redirect_max' => 1, 'exceptions' => false, ]); $client->doSomething();
Installation
composer require aaharu/curlsoapclient ## for old PHP # composer require aaharu/curlsoapclient:1.2.0
Contributing
With composer installed, run the following from the root of the repository:
composer install
Running the tests
## running built-in server before execute `composer test` # php -ddisplay_errors=stderr -S localhost:8000 & composer test
License
Licensed under the MIT License.
统计信息
- 总下载量: 8.39k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-09-20