PHP - SOAP客户端无法调用HTTPS端点 [英] PHP - SOAP Client Unable to Call HTTPS Endpoint
问题描述
我遇到一个问题,我无法从其他服务器调用web服务,它显示如下错误:
I have a problem that I can't call the webservice from other server and it shows error like this :
获取http标头时出错
当我查看更详细的错误时,我意识到端点不对。例如,我在我的PHP代码中写了这个
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));
端点应该在 https 中,但错误显示端点以 http 开头 - > http://www.example.com:17819/wsdl/sample.php?wsdl
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
什么是我错过了我的php客户端代码?
What am I missing in my php client code?
谢谢
推荐答案
我刚刚解决了这个问题。
我用 nusoap_client
来解决这个问题。
我也改变了请求格式,比如这个
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'>";
等等..
谢谢
这篇关于PHP - SOAP客户端无法调用HTTPS端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!