Cyrille - 2010-11-05

I like to make code not aware of underlying technologies, so, NuSoap can only catch soap_fault and nusoap_fault. It's not nice to have to throw this kind of error in clean code.
So, I did a little hack in NuSOAP to get it aware of throwing PHP Exception. It's perhaps not the better solution, but while waiting a evolution of NuSOAP, it's work :-)

In nusoap_server::service() method, when it handle a POST i've encapsulted the invoke_method() call into a try/catch and automaticly map the Php Exception to a soap_fault.

        if ($rm == 'POST') {
            $this->debug("In service, invoke the request");
            if (! $this->fault)
                catch( Exception $ex )
                    $this->methodreturn = new soap_fault(
            if (! $this->fault) {