Today, I have faced a problem with SOAP client constructor. I have used an invalid URL to check the SOAP Client constructor. It should return some exceptions or error response if the URL is invalid. But unfortunately it returned nothing. I did not get any handler or exceptions. Then I have found XDEBUG EXTENSION for PHP which really helps to generate some exceptions or SOAP fault responses.

Here is sample code of XDEBUG functions with SOAP:


$nfxweb_url = 'http: //wrong-url------';
 try {
        if (function_exists('xdebug_disable')) {
        return new SoapClient($nfxweb_url, Array('trace'=>true, 'exceptions'=>true));
 catch(Exception $exception) {
 if (function_exists('xdebug_enable')) {

For more you can explore the followings:

Add new comment