ZF-7806: Local client never throws SoapFault(s)


Zend_Soap_Client_Local doesn't correctly handle Soap Faults. Take the following code:

function throwException() {
    throw new Exception('Exception message goes here');

$server = new Zend_Soap_Server(NULL, array('location' => '', 'uri' => ''));

$client = new Zend_Soap_Client_Local($server, NULL, array('location' => '', 'uri' => ''));

try {
    echo ' We got past $client->throwException()';
catch (SoapFault $f) {
    echo 'We caught a SoapFault!';

h4. Expected result "We caught a SoapFault!'

h4. Actual result

<?xml version="1.0" encoding="UTF-8"?>">Receiver
    Exception message goes here


I've traced this down to the following lines in {{Zend_Soap_Server::handle()}}:

try {
} catch (Exception $e) {
    $fault = $this->fault($e);
    $soap->fault($fault->faultcode, $fault->faultstring);

The problem is that {{$soap->fault()}} (i.e. PHP's SoapServer::fault()) terminates execution. I've submitted a PHP bug report:

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.