inteleon/

soap-client

Inteleon Soap 客户端

v1.0.3 2015-02-02 17:23 UTC

This package is not auto-updated.

Last update: 2024-09-14 16:29:26 UTC


README

扩展原生PHP Soap客户端,增加了一些选项。该类使用cURL来发送请求。

安装

运行: composer require inteleon/soap-client

如何使用

使用方式与原生的SoapClient类相同。

选项

超时时间(毫秒)

$client->setTimeout(30000); //The maximum number of milliseconds to execute.
$client->setConnectTimeout(30000); //The number of milliseconds to wait while trying to connect.

连接尝试次数

$client->setConnectAttempts(2); //Number of connect attempts if connection fails

验证SSL证书

$client->setVerifyCertificate(true); //Verify the SSL certificate. WARNING: Turning off CURLOPT_SSL_VERIFYPEER allows man in the middle (MITM) attacks, which you don't want!

HTTP用户代理

$client->setUserAgent('Foo');

自定义cURL选项

$client->setCurlOption(CURLOPT_XXX, ''); //See https://php.ac.cn/manual/en/function.curl-setopt.php

待办事项

  • 能够在获取WSDL时设置超时/选项。由于原生SoapClient似乎在构造函数中完成此操作,因此很难覆盖它。
  • 更多和更好的测试