Versions Compared

Key

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

...

Code Block
languagehtml/xml
linenumberstrue
<definitions xmlns="http://ws.apache.org/ns/synapse">
   <sequence name="main">
     <in>
       <!-- filtering of messages with XPath and regex matches -->
       <filter source="get-property('To')" regex=".*/StockQuote.*">
           <header name="Action" value="urn:getQuote"/>
           <send>
               <endpoint>
                   <address uri="http://localhost:9000/services/SimpleStockQuoteService" format="soap11"/>
               </endpoint>
           </send>
       </filter>
     </in>
     <out>
          <send/>
     </out>
   </sequence>
</definitions>

Prerequisites:

  • Navigate to <ESB_HOME>/repository/samples, open synapse_sample_50.xml for editing, and replace the contents with the configuration above. (This step is required because of a bug in the sample that shipped with this release.) Save the file and close it.
  • Start the Synapse configuration numbered 50: i.e. wso2esb-samples.sh -sn 50
  • Start the Axis2 server and deploy the SimpleStockQuoteService if not already done.

...

Code Block
languagebash
ant stockquote -Dtrpurl=http://localhost:8280/services/StockQuote -Drest=true

This example shows a http an HTTP REST request (as shown below) being transformed into a SOAP request and forwarded to the stock quote service.

...