SSL:使用 PHP 的 SoapClient 访问 SOAP 服务的管道损坏
我有一个 SOAP WS,可以通过 PHP 的 SoapClient(用 Zend Framework 的 Soap Client 包装)访问它。 Web服务通过https运行,并且调用需要相当长的时间(每次调用几分钟)。
我正在通过同一个 SoapClient 实例一个接一个地进行 4 个调用。但是,运行一段时间后,在随机点(并非总是在同一方法调用上)我看到以下错误:
警告:SoapClient::__doRequest():SSL:pathtomyfile 中的管道损坏
I have a SOAP WS which I access through PHP's SoapClient (wrapped with Zend Framework's Soap Client). The webservice runs through https, and the calls take quite some time (a few minutes each).
I am making 4 calls, one after another through the same instance of SoapClient. However, after some time running, and at a random point (not allways on the same method call) I see the following error:
Warning: SoapClient::__doRequest(): SSL: Broken pipe in pathtomyfile
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现添加选项
可以
为我解决问题。
这里有一个相关的错误报告,但除此之外很少有相关文档: https:// /bugs.php.net/bug.php?id=60329
I found that adding the
option to
solved the issue for me.
There is a related bug report here but very little documentation about it apart from that: https://bugs.php.net/bug.php?id=60329
我仍然不知道为什么会发生这种情况,但我有一些额外的见解和解决方法。
当 SOAP 调用运行时间很长之后,我尝试对另一个请求使用相同的连接时,就会出现问题。第一个将成功,但在新的调用时,会出现错误。
这意味着,只要您不需要连接相同(SOAP Web 服务上通常是这种情况),您就可以重置调用之间的连接。不是最有效地利用资源,但可以完美地工作。
I still have no idea why this happened, but I've got some extra insight and a workaround.
The issue arises when, after a SOAP call that took really long to run, I try to use the same connection for another request. The first one will succeed, but upon the new call, the error raises.
This means, that as long as you don't NEED the connection to be same (which is usually the case on SOAP web services), you can just reset the connection between calls. Not the most efficient use of resources, but will work flawlessly.