Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Download and install WSO2 ESB from http://wso2.com/products/enterprise-service-bus. For a list of prerequisites and step-by-step installation instructions, refer to Installation Guide in the WSO2 ESB documentation.
  2. Start the sample Axis2 server instances. For instructions, refer to the section Setting Up the ESB Samples - Starting the Axis2 server in the WSO2 ESB documentation.

...

Code Block
languagehtml/xml
linenumberstrue
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
   <proxy name="RoutingSlipProxy" transports="http https" startOnLoad="true">
      <target>
         <inSequence>
			<!-- Will Attach The Routing Slip -->
            <header xmlns:m1="http://services.samples"
                    name="m1:RoutingSlip"
                    value="Process_A"/>
            <header xmlns:m1="http://services.samples"
                    name="m1:RoutingSlip"
                    value="Process_C"/>
            <log level="full"/>
			<!-- Will Perform All The Steps Based on The Slip -->
            <iterate xmlns:m0="http://services.samples"
                     preservePayload="true"
                     expression="//m0:RoutingSlip">
               <target>
                  <sequence>
                     <switch xmlns:m2="http://services.samples" source="//m2:RoutingSlip">
                        <case regex="Process_A">
                           <sequence key="process_a"/>
                        </case>
                        <case regex="Process_B">
                           <sequence key="process_b"/>
                        </case>
                        <case regex="Process_C">
                           <sequence key="process_c"/>
                        </case>
                        <default>
                           <drop/>
                        </default>
                     </switch>
                  </sequence>
               </target>
            </iterate>
         </inSequence>
         <outSequence>
            <drop/>
         </outSequence>
      </target>
   </proxy>
   <sequence name="process_b">
      <log level="custom">
         <property name="Process" value="B"/>
      </log>
   </sequence>
   <sequence name="process_c">
      <log level="custom">
         <property name="Process" value="C"/>
      </log>
   </sequence>
   <sequence name="process_a">
      <log level="custom">
         <property name="Process" value="A"/>
      </log>
      <sequence key="send_seq"/>
   </sequence>
   <sequence name="fault">
      <log level="full">
         <property name="MESSAGE" value="Executing default &#34;fault&#34; sequence"/>
         <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
         <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
      </log>
      <drop/>
   </sequence>
   <sequence name="send_seq">
      <send>
         <endpoint name="simple">
            <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
         </endpoint>
      </send>
   </sequence>
   <sequence name="main">
      <log/>
      <in/>
      <out/>
   </sequence>
</definitions>

...