简体   繁体   English

PHP-SOAP客户端无法调用HTTPS端点

[英]PHP - SOAP Client Unable to Call HTTPS Endpoint

I have a problem that I can't call the webservice from other server and it shows error like this : 我有一个问题,我无法从其他服务器调用Web服务,它显示如下错误:

Error Fetching http headers 提取HTTP标头时出错

When I looked into more detailed error, I realized that the endpoint is not right. 当我查看更详细的错误时,我意识到端点不正确。 For example, I wrote this in my php code 例如,我在我的php代码中写了这个

$client=new SoapClient('https://www.example.com:17819/wsdl/sample.php?wsdl', array("trace" => 1, "connection_timeout" => 5, "exceptions" => 1));

The endpoint supposed to be in https , but the error shows that the endpoint begins with http --> http: //www.example.com:17819/wsdl/sample.php?wsdl 端点应该在https中 ,但错误显示端点以http- > http开头://www.example.com:17819/wsdl/sample.php?wsdl

What am I missing in my php client code? 我的php客户端代码中缺少什么?

Thanks 谢谢

I just solved this issue. 我刚刚解决了这个问题。 I used nusoap_client to solve this issue. 我使用nusoap_client解决了这个问题。 And I change the request format too, like this 我也更改了请求格式,像这样

$msg = "<soapenv:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:urn='urn:sj_service'>";

And so on.. 等等..

Thanks 谢谢

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

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