PHP SoapClient 超时 [英] PHP SoapClient times out

查看:32
本文介绍了PHP SoapClient 超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从运行该服务的同一台服务器上调用 Soap 客户端以进行测试.我的 WSDL 位于:http://www.installittoday.com/api/server.php?wsdl 我正在尝试简单地加载它:

<预><代码>$client = new SoapClient('http://www.installittoday.com/api/server.php?wsdl');

但我得到了错误:

<前><代码>警告:SoapClient::SoapClient(http://www.installittoday.com/api/server.php?wsdl) [soapclient.soapclient]:无法打开流:/home/installi/public_html/api/client 中的连接超时第 4 行的 .php警告:SoapClient::SoapClient() [soapclient.soapclient]:I/O 警告:无法在/home/installi/public_html 中加载外部实体http://www.installittoday.com/api/server.php?wsdl"/api/client.php 第 4 行致命错误:未捕获的 SoapFault 异常:[WSDL] SOAP 错误:解析 WSDL:无法从http://www.installittoday.com/api/server.php?wsdl"加载:无法加载外部实体http://www.installittoday.com/api/server.php?wsdl" in/home/installi/public_html/api/client.php:4 堆栈跟踪:#0/home/installi/public_html/api/client.php(4): SoapClient->SoapClient('http://www.inst...') #1 {main} 在第 4 行的/home/installi/public_html/api/client.php 中抛出

但是我可以从我的另一个站点很好地设置客户端.这是防火墙问题还是什么?

解决方案

确保在您的 php.ini

中启用这些扩展

extension=php_curl.dll扩展=php_openssl.dll扩展名=php_soap.dll

I'm trying to call a Soap Client for testing purposes from the same server that I'm running the service on. My WSDL is at: http://www.installittoday.com/api/server.php?wsdl I'm trying to load it simply with:


    $client = new SoapClient('http://www.installittoday.com/api/server.php?wsdl');

but I get back the error:


Warning: SoapClient::SoapClient(http://www.installittoday.com/api/server.php?wsdl) [soapclient.soapclient]: failed to open stream: Connection timed out in /home/installi/public_html/api/client.php on line 4  

Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity "http://www.installittoday.com/api/server.php?wsdl" in /home/installi/public_html/api/client.php on line 4  

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.installittoday.com/api/server.php?wsdl' : failed to load external entity "http://www.installittoday.com/api/server.php?wsdl" in /home/installi/public_html/api/client.php:4 Stack trace: #0 /home/installi/public_html/api/client.php(4): SoapClient->SoapClient('http://www.inst...') #1 {main} thrown in /home/installi/public_html/api/client.php on line 4

Yet I can set up the client just fine from another site of mine. Is this a firewall issue or what?

解决方案

Make sure these extensions are enabled in your php.ini

extension=php_curl.dll 
extension=php_openssl.dll 
extension=php_soap.dll

这篇关于PHP SoapClient 超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆