Friday, August 10, 2012

WSO2 ESB : How propagate the exception to the client

This can be done with the makefault mediator.

<makefault>
            <code value="tns:Receiver" xmlns:tns="http://www.w3.org/2003/05/soap-envelope"/>
            <reason expression="get-property('ERROR_MESSAGE')"/>
        </makefault>


Following proxy is an example


<proxy xmlns="http://ws.apache.org/ns/synapse" name="test11" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
   <target>
      <inSequence>
         <makefault version="soap12">
            <code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver" />
            <reason expression="get-property('ERROR_MESSAGE')" />
         </makefault>
         <send />
      </inSequence>
      <outSequence>
         <log level="full" />
         <send />
      </outSequence>
   </target>
</proxy>
                               

No comments:

Post a Comment

Using Zotero for academic writing