Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wso2 : ESB faultsequence

how to use faultsequence of proxy in esb

i want to use faultsequence when occur a fault in EndPoint. for example i stop service1 using jconsole and want to route message to service2 when call proxy service. but when i call proxy using soapui it show fault this message : The system is attempting to access an inactive service..

<target>
  <inSequence >
     <send>
        <endpoint name="cal" >     
         <address uri="http://localhost:9763/services/service1/"/>   
        </endpoint>
     </send>
  </inSequence>
  <faultSequence>
     <log level="custom">
        <property name="text" value="An unexpected error occured for service"/>
        <property name="message" expression="get-property('ERROR_MESSAGE')"/>
    </log>
     <send>
        <endpoint>
           <address uri="http://localhost:9763/services/service2/"/>
        </endpoint>
     </send>
  </faultSequence>

please guide me!

like image 927
Ramtin Ramtin Avatar asked Sep 10 '26 23:09

Ramtin Ramtin


1 Answers

When your endpoint 1 is inactive it returns a soap fault and you want it to go to the fault sequence. But at the moment that fault sequence is considered as a response and it is sent to the client (soap ui).

In WSO2 ESB 4.5.0 onwards, there is a new property FORCE_ERROR_ON_SOAP_FAULT added. By setting this property, soap faults will be directed to fault sequence. You can do your next logics when you are in the fault sequence (for example invoking another sequence).

Refer [1] for a sample proxy service.

[1] http://maharachchi.blogspot.com/2012/09/now-you-can-send-soapfaults-to-fault.html

like image 142
Amila Maharachchi Avatar answered Sep 15 '26 02:09

Amila Maharachchi