Note that the SoapClient.__doRequest() method circumvents the throwing of SoapFault exceptions.
Specifically, if you call the __doRequest() method and it fails, it would normally throw a SoapFault exception. However, the __doRequest() method doesn't actually throw the exception. Instead, the exception is saved in a class attribute called SoapFault.__soap_fault, and is actually thrown AFTER the __doRequest method completes (but the call stack will show that the exception was created inside the __doRequest method.
I successfully used the following code to query the locally cached exception object that was not thrown:
<?php
$exception = null;
try {
$result = parent::__doRequest($request, $location, $action, $version, $one_way);
}
catch (SoapFault $sf) {
$exception = $sf;
}
catch (Exception $e) {
$exception = $e;
}
if((isset($this->__soap_fault)) && ($this->__soap_fault != null)) {
$exception = $this->__soap_fault;
}
if($exception != null) {
throw $exception;
}
?>