title: Laravel test connection to SOAP WDSL and exception handling
body: <p>I use the laravel framework and I want to check if a connection to Soap server was successful or not, without the app dying with fatal error.</p>
  
  <p>Both this:</p>
  
  <pre><code>$this-&gt;client = @new SoapClient("http://some.url/test.wsdl");
                  $this-&gt;session = $this-&gt;client-&gt;login("username", "password");
                  if (is_soap_fault($this-&gt;session)) {
                     return "Error";
                  }
  </code></pre>
  
  <p>And this:</p>
  
  <pre><code>try {
   $this-&gt;client = @new SoapClient("http://some.url/test.wsdl");
   $this-&gt;session = $this-&gt;client-&gt;login("username", "password");
  } catch (SoapFault $e) {
      return "Error";
  }
  </code></pre>
  
  <p>Result in a fatal error:</p>
  
  <pre><code>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"
  </code></pre>
  
  <p>Thanks</p>