PHP SoapClient 超时

标签 php web-services timeout soap-client

无论如何,SoapClient 请求是否会超时并抛出异常。截至目前,我得到 PHP 服务器响应超时,在我的例子中是 60 秒。基本上我想要的是,如果在一定时间内没有来自 Web 服务的任何回复,则会抛出一个异常,我可以捕获它。 60 秒警告不是我想要的。

最佳答案

ini_set("default_socket_timeout", 15);
$client = new SoapClient($wsdl, array(......));

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.

关于PHP SoapClient 超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3500527/

相关文章:

php - 将字符串转换为 JSON,通过 JQuery.Ajax 获取

php - 在 WooCommerce 中设置最低未折扣订单金额

javascript - 为什么我们使用 web 服务的 web 方法,而不是 web 表单函数

java - 如何在Tomcat中启动Mule?

c - 限制c中函数的执行时间

javascript - Magento 中的元素 null

javascript - mysql 查询返回 false,mysql 插入有效但回显语句不显示

android - 使用 Android 的 Web 服务进行身份验证的正确方法

php - 从 PHP 对 MysqlQuery 强制超时

javascript - 使用 javascript timeOut() 的正确方法