Proper SOAP_Fault Usage

From: Date: Fri, 09 May 2003 17:32:12 +0000
Subject: Proper SOAP_Fault Usage
Groups: php.soap 
Request: Send a blank email to php-soap+get-586@lists.php.net to get a copy of this message
So I've been trying to figure out what is the proper way to use SOAP_Fault in PEAR::SOAP. I can easily send back a message and the side that I feel the fault was caused by, but what I want to do is start categorizing my faults with a standard set of error codes, while still sending the message and the side that I feel caused the fault. 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. Thanks, Rob

« previous php.soap (#586) next »