All docs This doc

Versions Compared


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


Before digging into implementation details, let's take a look at the relationship between the example scenario and the Routing Slip EIP by comparing their core components.

Routing Slip EIP (Figure 1)Routing Slip Example Scenario (Figure 2)
Request MessageSimple Stock Quote Request
Routing Slip

Header Mediator appends node to SOAP header

Proc A/B/CSequence

Environment setup

  1. Download and install WSO2 ESB from 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
 <?xml version="1.0" encoding="UTF-8"?><definitions xmlns="">
<definitions xmlns=""> 
    <proxy name="RoutingSlipProxy" transports="http https" startOnLoad="true">
                <!-- 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   valuelevel="Process_Cfull"/>
            <log level="full"/>
			    <!-- Will Perform All The Steps Based on The Slip -->
                <iterate xmlns:m0="http://services.samples"
                     preservePayload="true" expression="//m0:RoutingSlip" sequential="true">
              <target>            <sequence>
      <sequence>                      <switch xmlns:m2="http://services.samples" source="//m2:RoutingSlip">
                                <case regex="Process_A">
                                    <sequence key="process_a"/>
                                <case regex="Process_B">
                                    <sequence key="process_b"/>
                                <case regex="Process_C">
                                    <sequence key="process_c"/>
    <sequence name="processsend_bseq">
 <log level="custom">          <property<endpoint name="Processsimple" value="B"/>>
        </log>    </sequence>    <sequence<address nameuri="process_c"http://localhost:9000/services/SimpleStockQuoteService"/>
      <log level="custom">          <property name="Process" value="C"/></endpoint>
    <sequence name="process_ac">
        <log level="custom">
            <property name="Process" value="AC"/>
        <sequence key="send_seq"/>
    <sequence name="faultprocess_b">
        <log level="fullcustom">
 <property name="MESSAGE" value="Executing default &#34;fault&#34; sequence"/>          <property name="ERROR_CODEProcess" expressionvalue="get-property('ERROR_CODE')B"/>
         <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>       </log>

    <sequence name="sendprocess_seqa">
      <send>          <endpoint name<log level="simplecustom">
            <address<property uriname="http://localhost:9000/services/SimpleStockQuoteService"/>
   <sequence name="main">
      <log/>Process" value="A"/>


  1. Send a request like the following to the client.

    ant stockquote -Dtrpurl=http://localhost:8280/services/RoutingSlipProxy -Dsymbol=foo
  2. Note that the steps are attached to the message header initially. Thereafter, processing will be decided based on the attached slip. You can observe process A and process C being logged in the ESB management console.
    Axis2 Sever output: :: Generating quote for : foo

    Client output: 

    Standard :: Stock price = $155.1065862596588

    ESB Console output:

     [EI-Core]  INFO - LogMediator Process = A

    [EI-Core]  INFO - LogMediator Process = C

    You can also allow the message to flow through Process B by indicating a header in the following manner.

    Code Block
    <header xmlns:m1="http://services.samples"

    If you add the above header at the beginning, you will notice the message going through Process B as well.