Monday, April 26, 2010

SOAP Fault in OSB

see also

this is what the WS method does:

    public void generateFault1() throws Exception {
        throw new Exception("ciao1");

and this is what the method generates when run in OSB

    <soapenv:Envelope      xmlns:soapenv="">
    <faultstring>BEA-380001: Internal Server Error</faultstring>
    <con:fault      xmlns:con="">
    <con:reason>Internal Server Error</con:reason>

This is the structure of the fault element

This is how to declare the faults generated by an operation:

here in more details

A really interesting article defining Business Faults versus System Faults, and Fault handling Policies

nothing new really, in the Java world there are the same concepts, much better defined.

The fascinating thing is that in the Error Handler you have all sort of information disseminated in 2 places: the $fault variable and the $body variable

$fault: <con:fault xmlns:con="">
  <con:reason>Internal Server Error</con:reason>

$body: <env:Body xmlns:
      <java:PierreException xmlns:java="java:com.pierre.exceptions"/>

(the exception being thrown is new com.pierre.exceptions.PierreException("ciao2")

The complete stacktrace is missing though...

No comments: