1
votes

When I read a message with a WSO2 ESB Proxy, I need to define a specific datatype and this is then applying a certain MessageBuilder (defined in the axis2.xml).

But when the MessageBuilder fails (i.e. I try to read a text file with the XMLBuilder) I get an exception in the console, but my "faultSequence" is not called. But I need to do a certain Error Handling in case of any read problem.

How can I catch Exceptions from the Transport Layer (MessageBuilder) in a Proxy?

2

2 Answers

1
votes

As far as i understand , your requirement is to catch an Error in the Transport layer and handle that in the Application level (i.e : Mediation level). which means the layer above.

But i think it violates layered architecture of the messaging framework. You should catch the Exception at the Message Builder itself and throw an Axis Fault so that underlying synapse transport layer (in this case Axis2) will handle that error. (It will send a fault to the client.)

If we look at the TCP protocol stack that is the practice which is commonly used.

If you really want to filter this errors at mediation level. Catch that Error in the Message Builder and add a Message Context property or custom message and pass it as a successful message. And Do a filter in mediation level and handle.

But again that is ugly. :)

--Charith

-1
votes

Have you defined onError attribute in your configuration?

 <sequence name="main" onError="myFaultSequence">

You can have more information in this sample.