Faults

From: Date: Wed, 20 Apr 2005 20:15:24 +0000
Subject: Faults
Groups: php.soap 
Request: Send a blank email to php-soap+get-1881@lists.php.net to get a copy of this message
Is there a way to have a SOAP server throw a custom fault? EG: not a SOAP server fault? I know how to define a custom fault in WSDL, but I don't understand how I would cause one to be triggered. For instance, lets say I have a SOAP service that takes your zip code and returns the temperature at that location. If someone enters valid data, say 90210 as a zip code, it will return an numeric temperature. However, maybe the data for 90210 doesn't exist on the server side, and I want to toss a fault (not a server fault, since the server is actually performing correctly, but an application fault). Saying that the data doesn't exist at this time. Or, lets say the user enters an invalid zip code. I don't want a SOAP server fault, but yet again an application fault. The only method I've seen server side for throwing is SoapServer->fault(). Is this used for SOAP faults and non-SOAP faults? Are there any examples of usage?

« previous php.soap (#1881) next »