Last active
August 29, 2015 14:08
-
-
Save hasithaa/d5e33b1005d9698e6ff0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<api xmlns="http://ws.apache.org/ns/synapse" name="Transform" context="/Transform"> | |
<resource methods="POST"> | |
<inSequence> | |
<property name="messageType" value="application/json" scope="axis2"></property> | |
<log level="custom"> | |
<property name="Status" expression="json-eval($.StockQuotes.Stock)"></property> | |
</log> | |
<filter source="json-eval($.StockQuotes.Stock.Symbol)" regex="null"> | |
<then> | |
<payloadFactory media-type="json"> | |
<format>{ "StockQuotes": { "Stock": $1 } }</format> | |
<args> | |
<arg evaluator="json" expression="$.StockQuotes.Stock"></arg> | |
</args> | |
</payloadFactory> | |
</then> | |
<else> | |
<payloadFactory media-type="json"> | |
<format>{ "StockQuotes": { "Stock": [ $1 ] } }</format> | |
<args> | |
<arg evaluator="json" expression="$.StockQuotes.Stock"></arg> | |
</args> | |
</payloadFactory> | |
</else> | |
</filter> | |
<respond></respond> | |
</inSequence> | |
</resource> | |
</api> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment