PHP - SOAP Client Unable to Call HTTPS Endpoint

懵懂的女人 提交于 2019-12-13 00:47:07

问题


I have a problem that I can't call the webservice from other server and it shows error like this :

Error Fetching http headers

When I looked into more detailed error, I realized that the endpoint is not right. For example, I wrote this in my php code

$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

What am I missing in my php client code?

Thanks


回答1:


I just solved this issue. I used nusoap_client to solve this issue. 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



来源:https://stackoverflow.com/questions/35547475/php-soap-client-unable-to-call-https-endpoint

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!