2008年11月12日星期三

[fw-webservices] Bug in Zend_Soap_Server

Hi,

 

In Zend_Soap_Server, PHP errors are caught and thrown as SoapFaults. This happens in the public function ‘fault’ at line 764 of Zend/Soap/Server.php.

 

The problem is that the SoapFault is thrown with the PHP errorcode as SoapFault code. This doesn’t work because a SoapFault Code can only be ‘SERVER’ or ‘SENDER’ or ‘RECEIVER’.

 

When php errors are thrown as soapfault, the error code of the soapfault should be ‘SERVER’ because the server is the one giving problems.

 

Now when something goes unexpectedly wrong, I get the following error:

 

PHP Fatal error:  SoapFault::SoapFault() [<a href='soapfault.soapfault'>soapfault.soapfault</a>]: Invalid parameters. Invalid fault code. in library/Zend/Soap/Server.php on line 779

 

That means line 779 should change from:

return new SoapFault($code, $message);

 

To something like this:

return new SoapFault('SERVER', $code . " - " . $message);

 

regards,

Dieter

没有评论: