This documentation is for WSO2 Enterprise Service Bus version 4.8.0 . View documentation for the latest release.

All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Objective: POX to SOAP conversion

Following is the XML configuration for the sample:

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:

  • 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.

Execute the 'ant stockquote' specifying that the request should be a REST request as follows:

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

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

Code Block
POST /services/StockQuote HTTP/1.1
Content-Type: application/xml; charset=UTF-8;action="urn:getQuote";
SOAPAction: urn:getQuote
User-Agent: Axis2
Host: 127.0.0.1
Transfer-Encoding: chunked

75
<m0:getQuote xmlns:m0="http://services.samples/xsd">
   <m0:request>
      <m0:symbol>IBM</m0:symbol>
   </m0:request>
</m0:getQuote>0
Excerpt
hiddentrue

sample on POX to SOAP conversion