H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
WSO2 Advantage Webinar - JSON Support in the WSO2 Platform
1. WSO2 Advantage Webinar - JSON Support in the WSO2
Platform
Ishan Jayawardena
Software Engineer
2. About WSO2
• Providing the only complete open source componentized cloud platform
Dedicated to removing all the stumbling blocks to enterprise
agility
Enabling you to focus on business logic and business value
• Recognized by leading analyst firms as visionaries and leaders
Gartner cites WSO2 as visionaries in all 3 categories of
application infrastructure
Forrester places WSO2 in top 2 for API Management
• Global corporation with offices in USA, UK & Sri Lanka
200+ employees and growing
• Business model of selling comprehensive support & maintenance for
our products
3. JSON
●
A data interchange format that is,
Lightweight
Text-based
Language independent
Human/machine readable
●
A better data interchange format
●
JSON and JavaScript
●
JSON object
{“company” : “WSO2 Inc.”, “product” : “ESB”}
●
Internet Media type
application/json
4. JSON Support in WSO2 Platform
●
Message Builders and Message Formatters
●
Constructing, and processing payloads
JSON, and XML with Script mediator
●
Converting message type between JSON and XML
6. Message Builders and Formatters
● What message builders and formatters are available for JSON?
● Builds XML infoset
org.apache.axis2.json.JSONBuilder.
org.apache.axis2.json.JSONMessageFormatter
● Process as JSON
org.apache.axis2.json.JSONStreamBuilder
org.apache.axis2.json.JSONStreamFormatter
● How to configure
Register Builder/Formatter in
ESB_HOME/repository/conf/axis2/axis2.xml
<messageBuilder contentType="application/json"
class="org.apache.axis2.json.JSONStreamBuilder"/>
<messageFormatter contentType="application/json"
class="org.apache.axis2.json.JSONStreamFormatter"/>
7. Constructing, Processing Payloads
● Script mediator with JavaScript
<script language="js"><![CDATA[
var symbol = ...
var price = ...
mc.setPayloadJSON({
"quote" : {
"code" : symbol,
"price" : price
}
});
]]></script>
● Where to construct payloads?
In sequence, out sequence
● Setting “messageType” property - Optional
<property name="messageType" scope="axis2"
value="application/json"/>
15. Other JSON Builder/Formatter
●
Converts JSON into SOAP/XML
org.apache.axis2.json.JSONBuilder
org.apache.axis2.json.JSONMessageFormatter
●
Best for;
20. Engage with WSO2
• Helping you get the most out of your deployments
• From project evaluation and inception to development and going into
production, WSO2 is your partner in ensuring 100% project success