WSO2 ESB - Fault Mediator

Fault Mediator

The fault mediator transforms the current message into a fault message, but does NOT send it. The <send> mediator needs to be invoked to send a fault message created this way. The fault message "To" header is set to the "Fault-To" of the original message if such a header exists on the original message. If a 'version' attribute is specified, the created fault message will be created as a selected SOAP 1.1, SOAP 1.2 or POX fault.

Syntax

 <makefault [version="soap11|soap12|pox"]>
   <code (value="literal" | expression="xpath")/>
   <reason (value="literal" | expression="xpath")>
   <node>?
   <role>?
   <detail>?
 </makefault>

UI Configuration

Fault Mediator

Figure1: Fault Mediator

Version

You can select the version of the SOAP fault message that you want to create. Options are SOAP 1.1 and SOAP 1.2.

Fault Code

You can specify a fault code

Fault String

The detailed fault string of the fault code can specify here. It can be give either as a string value or as an expression. NSEditor: You can click this link to add namespaces if you are providing an expression. You will be provided another panel named 'Namespace Editor' where you can provide any number of namespace prefixes and url that you have used in the xpath expression. Here is an example of the use of namespaces in an expression.

Fault Actor

SOAP 1.1 fault actor(if you select SOAP 1.1)

SOAP 11 fault meditor

Figure2: SOAP 1.1 with fault expression selected

Detail

Some information about the fault can be added here

If you select SOAP 1.2, you can see the followings

SOAP 12 fault meditor

Figure2: SOAP 1.2 with fault expression selected

Reason

Reason is the fault reason describing the fault code

Role

SOAP 1.2 role names

Node

SOAP 1.2 node name

Example