Thursday, June 20, 2013

OSB-Create an fault with customized error code and error message

When you developed in OSB, you may want to provide a customized error code instead of BEA-xxxxxxx when you catch a fault. By the follow steps, you can replace the error code in fault and reply a fault with your customized error code.

In error handler,
1. Replace the error code with the customized error code by xpath ./ctx:errorCode  in fault2. Replace reason with your customized error message by xpath ./ctx:reason in fault
3. Replace the node contents by xpath . in body with $fault
4. Put a Reply at the end of error handling and select the radio button With Failure

For more detail about error handling in OSB, you can refer the follow blog of Eric.

Oracle Service Bus 11g, handling SOAP Faults


No comments: