This sample demonstrates the WSO2 Application Server's support for JSON, which comes from Apache Axis2.
For more information on how JSON works in Axis2, go to the following URLs:
Building the sample
The JSON support sample is located in
For more information, see Building Axis2 Samples.
The generated service (JSONService.aar) gets copied to the
<AS_HOME>/repository/deployment/server/axis2services directory automatically. If you start the WSO2 Application Server, and on the Main menu, under Services, click List the Deployed Services window will appear with the JSONService deployed.
The WSDL for the service should be viewable at:
Running the client
Use the script
run-client.sh (in Linux/Solaris) or
run-client.bat file (in Windows) to invoke the client using following optional parameters:
In the JSON sample, an XML element is sent to the Application Server via the client.
You can change the http port of the variable String epr =
<AS_HOME>/samples/JSON/src/org/wso2/appserver/sample/json/client/JSONClient.java and monitor the JSON object that is passed through to the Application Server, using a capturing tool such as TCP monitor.
The image above, depicts a JSON Object passing captured from the TCP monitor.