Home » Web Services » SOAP » Bug #4922
SOAP_Fault Handling
Details
| Submitted | 2005-07-26 15:21 UTC |
|---|---|
| From | pear at grundprinzip dot de |
| Assigned | yunosh |
| Status | Closed |
| Package | SOAP |
| PHP Version | 4.3.8 |
| OS | Windows XP |
| Roadmaps | (Not assigned) |
Comments
[2005-07-26 15:21 UTC] pear at grundprinzip dot de
Description:
------------
Hi,
I'm using the SOAP Package Version 0.9.1. I've noticed a problem using SOAP_Faults to report errors from your implemented method back to the client.
If you return a SOAP_Fault Object from your method, this will be wrapped in a normal SOAP Response (SOAP-ENV:Body), but not in an SOAP-ENV:Fault message.
In version 0.8.1 everything was well. In this new version there is a difference in the parseRequest() method. After calling the desired method it's no longer checked whether this method returns a SOAP_Fault Object.
By adding the lines:
if (PEAR::isError($method_response)) {
$this->_raiseSoapFault($method_response);
return null;
}
on line 458 and 391 (differend value, $hr instead of $method_response) in SOAP/server.php everything works well again.
Now, the response (in case of SOAP_Fault) is correctly wrapped in the SOAP-ENV. Without changing these lines, it's not possible to throw errors for the implemented method.
You can check this behavior by executing the example client script. The division by zero wont throw any error.