我遇到SoapClient(PHP)连接到主机的问题。
https://ws.ocasa.com/testecommerce/service.asmx?wsdl 我不知道为什么,我有这个回应:
SoapFault Could not connect to host
我正在使用laravel,我的代码是:
$auth = new \stdClass();
$auth->UserName = 'xxxxx';
$auth->PassWord = 'xxxxx';
$location = 'https://ws.ocasa.com/testecommerce/service.asmx';
$uri = 'https://ws.ocasa.com/testecommerce/service.asmx?WSDL';
$this->client = new \SoapClient(null,
[
'location'=>$location,
'uri'=>$uri
]);
$soap_header = new \SoapHeader('http://tempuri.org/','SecurityAccess',$auth,false);
$this->client->__setSoapHeaders($soap_header);
$this->client->__soapCall("GenerarRetiros", array([]));
我在SoapUI上尝试了这个WSDL,它完美无缺。所以它似乎不是WSDL。但是在代码中如果我替换下面那个的WSDL,那么错误就会消失,所以我不知道问题出在哪里,在代码中或在wsdl中。
https://id3check.gb.co.uk/gbportalinternational/aspx/id3check_1b.asmx?WSDL
谢谢