title: Debug SOAP call in PHP: An exception has been raised as a result of client data
body: <p>I am working with the UPS api and am having a difficult time debugging. I am getting the following stack trace:</p>
  
  <pre><code>Details
  Type: SoapFault
  Message: An exception has been raised as a result of client data.
  File: /Users/shawn/Documents/work/sites/Wingspan/kaleco/lib/SixString/Utilities/Ups.php
  Line: 161
  Trace
  
  #0 /Users/shawn/Documents/work/sites/Wingspan/kaleco/lib/SixString/Utilities/Ups.php(161): SoapClient-&gt;__soapCall('ProcessShipment', Array)
  #1 /Users/shawn/Documents/work/sites/Wingspan/kaleco/routes/ups.php(14): SixString\Utilities\Ups-&gt;getShipment()
  #2 [internal function]: {closure}()
  #3 /Users/shawn/Documents/work/sites/Wingspan/kaleco/vendor/slim/slim/Slim/Router.php(172): call_user_func_array(Object(Closure), Array)
  #4 /Users/shawn/Documents/work/sites/Wingspan/kaleco/vendor/slim/slim/Slim/Slim.php(1222): Slim\Router-&gt;dispatch(Object(Slim\Route))
  #5 /Users/shawn/Documents/work/sites/Wingspan/kaleco/vendor/slim/slim/Slim/Middleware/Flash.php(86): Slim\Slim-&gt;call()
  #6 /Users/shawn/Documents/work/sites/Wingspan/kaleco/vendor/slim/slim/Slim/Middleware/MethodOverride.php(94): Slim\Middleware\Flash-&gt;call()
  #7 /Users/shawn/Documents/work/sites/Wingspan/kaleco/vendor/slim/slim/Slim/Middleware/SessionCookie.php(116): Slim\Middleware\MethodOverride-&gt;call()
  #8 /Users/shawn/Documents/work/sites/Wingspan/kaleco/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\SessionCookie-&gt;call()
  #9 /Users/shawn/Documents/work/sites/Wingspan/kaleco/vendor/slim/slim/Slim/Slim.php(1174): Slim\Middleware\PrettyExceptions-&gt;call()
  #10 /Users/shawn/Documents/work/sites/Wingspan/kaleco/public/index.php(6): Slim\Slim-&gt;run()
  #11 {main}
  </code></pre>
  
  <p>Here is the block of code:</p>
  
  <pre><code>    try{
          $mode = array('soap_version' =&gt; 'SOAP_1_1',  'trace' =&gt; 1,'exceptions' =&gt; true );
          $client = new \SoapClient($wsdl , $mode);
          $client-&gt;__setLocation($endpointurl);
  
          $header = new \SoapHeader('http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0','UPSSecurity',$this-&gt;upss);
          $client-&gt;__setSoapHeaders($header);
  
          if(strcmp($operation,"ProcessShipment") == 0 ) {
              $resp = $client-&gt;__soapCall('ProcessShipment',array($this-&gt;processShipment()));
              echo "Response Status: " . $resp-&gt;Response-&gt;ResponseStatus-&gt;Description ."\n";
              //print_r($client-&gt;__getLastRequest());
          }
          else if (strcmp($operation , "ProcessShipConfirm") == 0) {
              $resp = $client-&gt;__soapCall('ProcessShipConfirm',array($this-&gt;processShipConfirm()));
              echo "Response Status: " . $resp-&gt;Response-&gt;ResponseStatus-&gt;Description ."\n";
          }
          else {
              $resp = $client-&gt;__soapCall('ProcessShipeAccept',array($this-&gt;processShipAccept()));
              //get status
              echo "Response Status: " . $resp-&gt;Response-&gt;ResponseStatus-&gt;Description ."\n";
              echo "&lt;pre&gt;";
              print_r($resp);
              echo "&lt;/pre&gt;";
          }
      }
      catch(Exception $ex){
          print_r ($ex);
      }
  </code></pre>
  
  <p>Line 161 is in the above code, this is the actual line:</p>
  
  <pre><code>$resp = $client-&gt;__soapCall('ProcessShipConfirm',array($this-&gt;processShipConfirm()));
  </code></pre>
  
  <p>I am looking for a way to debug this. It does not appear to be reaching the <code>catch</code> block and I cannot seem to determine the cause of the exception. </p>