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

Versions Compared

Key

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

...

Code Block
languagehtml/xml
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
    <sequence name="main">
        <in>
            <enrich>
                <source type="custom"
                        xpath="//m0:getQuote/m0:request/m0:symbol/text()"
                        xmlns:m0="http://services.samples"/>
                <target type="property" property="ORIGINAL_REQ"/>
            </enrich>
            <enrich>
                <source type="body"/>
                <target type="property" property="REQUEST_PAYLOAD"/>
            </enrich>

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

...