...
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://ws.apache.org/ns/synapse"> <localEntry <sequence keyname="price_reqmain"> <m0:symbol xmlns:m0="http://services.samples">MSFT</m0:symbol> <in> </localEntry> <localEntry key="init_req">MSFT</localEntry> <sequence name="fault"> <enrich> <log level="full"> <source <property nametype="MESSAGEcustom" value="Executing default "fault" sequence"/> <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/> <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/> </log> <drop/> </sequence> <sequence name="main"> <in>xpath="//m0:getQuote/m0:request/m0:symbol/text()" <enrich> <source xmlns:ns="http://org.apache.synapse/xsd" 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/xsd"custom" xmlns:ns1xpath="http//ns:getQuoteResponse//services.samples"ns:return/ax21:lastTradeTimestamp" xmlns:ns="http://org.apache.synapse/xsdservices.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/xsd"org" 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> |
4. Deploy the back-end service 'SimpleStockQuoteService' and start the Axis2 server using the instructions given in section Starting Sample Back-End Services.
...