Re: [SOAP] extending SoapFault
| From: | David | Date: | Sun, 05 Mar 2006 21:17:32 +0000 |
| Subject: | Re: [SOAP] extending SoapFault | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-2143@lists.php.net to get a copy of this message | ||
ADanTi wrote:
I spend some time trying to create my own faults which are subclasses of SoapFault. But all the time I get the "uncaught SoapFault exception" and "[Client] looks like we got no XML document" messages. Of course I put the
<wsdl:fault> element in wsdl description of service so it seems that there
is no support for the <wsdl:fault> elements. Is it true? Now I wonder if it's possible in php to make you own class extending SoapFault which will be handled as SoapFault...I think it's not possible, since internally it is checked if it's of type SoapFault. But an other solution is the following (credits to Dmitry), which will catch any exception and always result a soap fault: try { server->handle(); } catch (Exception $e) { $server->fault("Server", "Uncaught exception", "", $e->__toString()); } Kind regards, David