You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Michael Reardon <mi...@onewebsystems.com> on 2001/06/11 22:39:24 UTC

Uncaught exceptions

Forgive if this has already been discussed, but is there any good reason
not to use the java class name of an uncaught exception  in the Fault?
For example if Provider code threw an ClassCastException (lets say be
cause of casting a String to an Integer), the servlet catches it, and
generates a SOAP fault. The resulting Fault would have...

a fault code of:   SOAP-ENV:Server.Exception:
and fault string of:  java.lang.Integer

It sure would be make a more informative message if it looked something
like this...

a fault code of:  
SOAP-ENV:Server.RuntimeException[java.lang.ClassCastException]
and fault string of:  java.lang.Integer

Instead of the following from RPCRouterServler...

        SOAPException e = null;
        if (t instanceof SOAPException)
          e = (SOAPException)t;
        else
          e = new SOAPException(Constants.FAULT_CODE_SERVER +
                                ".Exception:", "", t);


How about something like this...

        SOAPException e = null;
        if (t instanceof SOAPException)
          e = (SOAPException)t;
        else
          e = new SOAPException(Constants.FAULT_CODE_SERVER +
                               
".RuntimeException["+t.getClass().getName()+"]", "", t);



BTW, why does "SOAP-ENV:Server.Exception:" end with a colon? The spec
says that the fault code should be a qualified name; is that a valid
qname with a second :?

Cheers,
Mike Reardon