RE: [SOAP] Proper SOAP_Fault Usage

From: Date: Fri, 08 Aug 2003 03:51:29 +0000
Subject: RE: [SOAP] Proper SOAP_Fault Usage
References: 1  Groups: php.soap 
Request: Send a blank email to php-soap+get-932@lists.php.net to get a copy of this message
> Rob Booth wrote: [snip] > > Here's what I'm doing now: > > return new SOAP_Fault("You need to send a valid ID", "Client"); > > > > This is all well and good, but what I want is to send along > an error > > code that the client can read and decide what to send to > the user. So > > say 101 = missing/invalid parameter then someone could code to this > > number instead of having to parse my string which could be > different > > for each SOAP call. > > > > So what is the proper way to do this? Does anyone have a good > > description of what the various fields in the SOAP_Faut constructor > > are used for? > > > > Any help is appreciated. > > The soap_fault constructor takes a bunch of additional stuff, but > basicly you have to use the 4th argument to the constructor, which is > the detail. detail can be whatever you want it to be. Can someone explain to me why the faultcode parameter is always "Client" - why can't the faultcode be used to convey extra error information in numerical form (like in PEAR_Error)? Tristan.

« previous php.soap (#932) next »