我使用laravel框架,並且我想檢查與Soap服務器的連接是否成功,沒有應用程序因致命錯誤而死亡。Laravel測試連接到SOAP WDSL和異常處理
兩個這樣的:
$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"
感謝