I\'m getting desperate, all I want is simple error handling when the PHP SOAP Web Service is down to echo an error message login service down. Please help me!
I ended up handling it this way:
libxml_use_internal_errors(true); $sxe = simplexml_load_string(file_get_contents($url)); if (!$sxe) { return [ 'error' => true, 'info' => 'WSDL does not return valid xml', ]; } libxml_use_internal_errors(false); Do your soap call after this check.
libxml_use_internal_errors(true); $sxe = simplexml_load_string(file_get_contents($url)); if (!$sxe) { return [ 'error' => true, 'info' => 'WSDL does not return valid xml', ]; } libxml_use_internal_errors(false);
Do your soap call after this check.