【发布时间】:2014-09-19 13:37:41
【问题描述】:
我使用 laravel 框架,我想检查与 Soap 服务器的连接是否成功,而应用程序不会因致命错误而死。
这两个:
$this->client = @new SoapClient("http://some.url/test.wsdl");
$this->session = $this->client->login("username", "password");
if (is_soap_fault($this->session)) {
return "Error";
}
还有这个:
try {
$this->client = @new SoapClient("http://some.url/test.wsdl");
$this->session = $this->client->login("username", "password");
} catch (SoapFault $e) {
return "Error";
}
导致致命错误:
Symfony \ Component \ Debug \ Exception \ FatalErrorException
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://some.url/test.wsdl' : failed to load external entity "http://some.url/test.wsdl"
谢谢
【问题讨论】:
标签: php exception soap laravel