无法使用https SOAP连接到主机,并且无法通过http连接到主机

时间:2019-04-16 11:11:49

标签: php web-services soap wsdl soap-client

在使用https之前,我很难用http调用Soap Web服务,并且它可以正常工作,现在将其更改为https,而我无法调用它:

SOAP内容的终点

<service name="someName">
    <port binding="tns:toto" name="somename123">
        <soap:address location="https://xx.xxx.xxx.xxx:100xx/web/services/somename456/somename789"/>
    </port>
</service>

使用http,我这样成功地称呼它:

<soap:address location="http://xx.xxx.xxx.xxx:100xx/x...
ini_set('soap.wsdl_cache_enabled',0);
ini_set('soap.wsdl_cache_ttl',0);

$url = 'ws/wervice_web_info.xml';
$credentials = array('login' => 'someLogin', 'password' => 'somePassword');

$soap = new SoapClient($url, $credentials);

现在使用https:我尝试了下面的代码,但没有成功

  

错误:抛出异常:无法连接到主机

<soap:address location="https://xx.xxx.xxx.xxx:100xx/x...

测试:

ini_set('soap.wsdl_cache_enabled',0);
ini_set('soap.wsdl_cache_ttl',0);

$url = 'ws/wervice_web_info.xml';
$my_cert_file = 'ws/certificate.pem";

$soap = new SoapClient($url, array('local_cert', $my_cert_file) );

0 个答案:

没有答案