Objective: Demonstrate the ability to switch expose a SOAP service over JSON by switching between JSON and XML/SOAP message formats using the XSLT mediator and Enrich Mediator.
...
Code Block | ||
---|---|---|
| ||
{ "getQuoteResponse":{ "return":{ "change":3.853593376681722, "earnings":12.802850763714854, "high":67.92488310190126, "last":66.14619264746406, "lastTradeTimestamp":"Mon Aug 23 16:48:40 IST 2010", "low":-66.04000424423522, "marketCap":-9334516.42324327, "name":"WSO2 Company", "open":-64.61950137150009, "peRatio":-19.78600441437058, "percentageChange":5.411779328273005, "prevClose":71.2075112994578, "symbol":"WSO2", "volume":16842 } } } |
The next sample demonstrates For more information about using JSON with the ESB, see JSON Support. For an example of how to convert JSON to XML using using JavaScript instead of XSLT. For more information about using JSON with the ESB, see JSON Support Sample 441: Converting JSON to XML Using JavaScript.