Can PHP SoapClient throw custom SoapFaults

401 views Asked by At

Is it possible to map \SoapFault to custom Exceptions like you can with objects?

I'm accessing an ESP's SOAP service through their WSDL. The WSDL defines a set of fault objects. Is it possible to create custom Exception classes so that \SoapClient will throw those instead of the generic \SoapFault?

1

There are 1 answers

0
Matthew Turland On BEST ANSWER

Offhand, the only suggestion I can make is using set_exception_handler() to catch the \SoapFault objects and re-throw them as custom exception instances.