使用soapclient的WSDL
需要使用soapclient访问网络服务。我有以下设置。
ini_set('default_socket_timeout', 120);
$client = new SoapClient(
"http://example.com/OnlineOrderProcessingWS.asmx?WSDL",
array('proxy_host' => "proxy url",
'proxy_port' => proxy port
)
);
$param=array("varname1"=>'value1',"varname2"=>'value2');
$result = $client->CustomerOrder($param);
print_r($result);
执行这个脚本抛出
致命错误:未捕获 SoapFault 异常:[HTTP] 获取 http 标头时出错。
Need to access a webservice using soapclient.I have the following settings.
ini_set('default_socket_timeout', 120);
$client = new SoapClient(
"http://example.com/OnlineOrderProcessingWS.asmx?WSDL",
array('proxy_host' => "proxy url",
'proxy_port' => proxy port
)
);
$param=array("varname1"=>'value1',"varname2"=>'value2');
$result = $client->CustomerOrder($param);
print_r($result);
Executing this script throwing
Fatal error: Uncaught SoapFault exception: [HTTP] Error Fetching http headers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此错误的最常见原因似乎是等待服务响应时超时。您已经将 socket_timeout 调整为 120,但可能想尝试更高的值。需要多长时间才能返回错误?
The most common reason for this error seems to be a timeout while waiting on the service response. You already adjust your socket_timeout to 120, but might want to try an even higher value. How long does it take for the error to be returned?