I have an issue that involves using different responses from a soap WS. I need to more of the returned object than is given to me by the WSClientException class. So the problem is either with the class and it's definition or with the line 79 of the wsclient_soap.module, where it only gives the getMessage() result to the constructor:
throw new WSClientException('Error invoking the SOAP service %name, operation %operation: %error', array('%name' => $this->service->label, '%operation' => $operation, '%error' => $e->getMessage()));
I propose using 2 separate Exception classes for the soap and rest WS with more specific definition and tools.

CommentFileSizeAuthor
#1 error-detail-1513694-1.patch2.57 KBjessejacobsen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jessejacobsen’s picture

Here is a patch containing some of the changes I made to get the response object from a failed REST request. I don't have SOAP enabled in my dev environment so I haven't been able to test to see if it is working.

The code catches a SoapFault $e and I'm assuming valuable information would be stored in $e->detail.

I modified the WSClientException class to hold the code and response returned when applicable.