Red Hat Training

A Red Hat training course is available for JBoss Enterprise SOA Platform

Chapter 9. Fault Handling

9.1. BPELInvoke Fault Handling

Depending on how you choose to configure the system, you can receive the fault as an ESB message or allow it to cause an exception which aborts the action pipeline. The configuration property that determines which behavior is to be used used is called abortOnFault. The default value for this property is "true".

9.2. BPELInvoke Fault Handling Reference

The following example material uses the Loan Fault quickstart:
        <action name="action2" class="org.jboss.soa.esb.actions.bpel.BPELInvoke">
 	<property name="service" value="{http://example.com/loan-approval/wsdl/}loanService"/>
	<property name="operation" value="request" />
	<property name="abortOnFault" value="true" />
</action>
A WSDL fault reports two pieces of information: the fault type and the details of the fault. Each of these is returned in a separate part of message's body:
  1. Fault code: javax.xml.namespace.QName
    ESB message body part: org.jboss.soa.esb.message.fault.detail.code
    This body part identifies the specific WSDL fault returned by the BPEL process.

    Warning

    The version of the QName used by the JBoss Enterprise SOA Platform server is found in the lib/endorsed/stax-api.jar file. (If this file is absent, you will encounter a class version exception.)
  2. Fault code (as a textual representation of the QName).
    ESB message body part: org.jboss.soa.bpel.message.fault.detail.code
    This body part returns the textual representation of the fault code's QName. This representation is of the form {namespace}localpart. (To convert it back into a QName, use the javax.xml.namespace.QName.valueOf(String) method.)
  3. Fault details
    ESB message body part: org.jboss.soa.esb.message.fault.detail.detail
    This body part contains the textual representation of the message content associated with the fault.