Versions Compared

Key

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

Insert excerpt
ESB Profile Samples
ESB Profile Samples
nopaneltrue

Objective: Demonstrate the basic functions of the URL Rewrite Mediator /wiki/spaces/EI6xx/pages/49612817.

Code Block
languagehtml/xml
<definitions xmlns="http://ws.apache.org/ns/synapse">

    <sequence name="main">
        <in>
            <rewrite>
                <rewriterule>
                    <action type="replace" regex="soap" value="services" fragment="path"/>
                </rewriterule>
            </rewrite>
            <send/>
        </in>
        <out>
            <send/>
        </out>
    </sequence>

</definitions>

Prerequisites:

  • Deploy the SimpleStockQuoteService in sample Axis2 server and start it on port 9000.
  • Create the above configuration and deploy it in the WSO2 EI profile, seeĀ Working with WSO2 Integration Studio.

Invoke the client as follows.

Code Block
ant stockquote -Dtrpurl=http://localhost:8280 -Daddurl=http://localhost:9000/soap/SimpleStockQuoteService

Note that the address URL of the client request contains the context 'soap'. But in the Axis2 server all the services are deployed under a context named 'services' by default. ESB will rewrite the To header of the request by replacing the 'soap' context with 'services. Hence the request will be delivered to the Axis2 server and the Axis2 client will receive a valid response.