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

All docs This doc

Versions Compared

Key

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

...

Code Block
languagehtml/xml
<definitions<?xml xmlnsversion="http://ws.apache.org/ns/synapse">
   <localEntry key="price_req">
      <m0:symbol xmlns:m01.0" encoding="UTF-8"?>
<definitions xmlns="http://services.samples">MSFT</m0:symbol>
   </localEntry>
   <localEntry key="init_req">MSFT</localEntry>
   <sequence name="fault"ws.apache.org/ns/synapse">
      <log level="full">
         <property name="MESSAGE" value="Executing default &#34;fault&#34; sequence"/<sequence name="main">
        <in>
<property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>          <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
  <enrich>
     </log>       <drop/>    </sequence>
   <sequence name<source type="maincustom">

     <in>          <enrich>             <source xmlns:nsxpath="http//m0:getQuote//org.apache.synapse/xsd"m0:request/m0:symbol/text()"
                        xmlns:m0="http://services.samples"/>
                <target    clonetype="trueproperty"                     xpath="//m0:getQuote/m0:request/m0:symbol/text()property="ORIGINAL_REQ"/>
            <target type="property" property="ORIGINAL_REQ"/>
  </enrich>
      </enrich>      <enrich>
   <enrich>             <source type="body" clone="true"/>
                <target type="property" property="REQUEST_PAYLOAD"/>
            </enrich>

            <enrich>
                <source type="inline" clone="true" key="init_req"/>
            <target xmlns:ns="http://org.apache.synapse/xsd"                     <target xmlns:m0="http://services.samples"
                        xpath="//m0:getQuote/m0:request/m0:symbol/text()"/>
            </enrich>
            <send>
                <endpoint>
                    <address uri="http://localhost:90019000/services/SimpleStockQuoteService"/>
                </endpoint>
            </send>
            <drop/>
        </in>
        <out>
            <header xmlns:urn="http://synapse.apache.org"
                 name="urn:lastTradeTimestamp"
                 value="foo"/>
            <enrich>
                <source xmlns:ax21type="http://services.samples/xsdcustom"
                    xmlns:ns1    xpath="http//ns:getQuoteResponse//services.samplesns:return/ax21:lastTradeTimestamp"
                        xmlns:ns="http://org.apache.synapse/xsd"
   services.samples"
                clone="true"                     xpath="//ns1:getQuoteResponse/ns1:return/ax21:lastTradeTimestamp/text()"/>
            <target xmlns:urnxmlns:ax21="http://synapse.apache.org"services.samples/xsd"/>
                   <target xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                        xmlns:nsurn="http://orgsynapse.apache.synapse/xsdorg"
                        xpath="/soapenv:Envelope/soapenv:Header/urn:lastTradeTimestamp/text()"/>
            </enrich>
             <log level="full"/>
         <log>       <log>
     <property xmlns:ns="http://org.apache.synapse/xsd"                       <property name="Original Request Symbol" expression="get-property('ORIGINAL_REQ')"/>
                <property    name="Request Payload" expression="get-property('ORIGINALREQUEST_REQPAYLOAD')"/>
            <property xmlns:ns="http://org.apache.synapse/xsd"</log>
            <send/>
         name="Request Payload"</out>
    </sequence>
    <localEntry key="init_req">MSFT</localEntry>
             expression="get-property('REQUEST_PAYLOAD')"/<localEntry key="price_req">
         </log>
         <send/>
 <m0:symbol xmlns:m0="http://services.samples">MSFT</m0:symbol>
    </out>
   </sequence>localEntry>
</definitions>

This configuration file  synapse_sample_15.xml is available in the <ESB_HOME>/repository/samples directory. 

...