问题
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