简体   繁体   English

间歇性“'无法连接到主机'”SOAP异常

[英]Intermittent “'Could not connect to host'” SOAP Exception

I have a site that uses the php SOAP client to connect to a ticketing system API, occasionally a call will throw up an exception saying 'Could not connect to host'. 我有一个使用php SOAP客户端连接到票证系统API的站点,偶尔一个调用会抛出一个异常,说“无法连接到主机”。 I'm pretty sure the SOAP server isn't going down so I'm struggling to understand what might be causing this. 我很确定SOAP服务器没有停机,所以我很难理解可能导致这种情况的原因。 I can't reproduce it myself either but I can tell it's happening from the logs. 我自己也无法重现它,但我可以从日志中发现它。

The site is running on php 5.3.3 and connecting to the server over https which might be a factor. 该站点在php 5.3.3上运行,并通过https连接到服务器,这可能是一个因素。

Does anyone have any ideas what might be causing this? 有没有人有任何想法可能导致这个?

This did get solved, turned out that the firewall of the ticketing system we were connecting to had a setting that limited the maximum number of connections from a single IP address. 这确实得到了解决,结果证明我们连接的票务系统的防火墙有一个限制来自单个IP地址的最大连接数的设置。 Since all the API requests were coming from one IP (the webserver) we were hitting this limit which triggered the error. 由于所有API请求都来自一个IP(网络服务器),我们达到了这个触发错误的限制。

To fix it an exception was added for our IP and we haven't seen it since. 为了解决这个问题,为我们的IP添加了一个例外,我们从那时起就没有看到它。

I was getting this error due to the fact that php didn't have the OpenSSL module installed and the service I was authenticating against required it. 由于php没有安装OpenSSL模块和我正在验证的服务需要它,我得到了这个错误。 If it's only happening intermittently though it sounds like there's a break in the connection along the way, either on your end or more likely on the end of the service. 如果它只是间歇性地发生,虽然听起来在途中连接中断,无论是在你的终端还是更有可能在服务结束时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM