Improve JSON support in Apache Axis2 with google-gson java library
by Shameera Rathnayaka for Apache Software Foundation
According to the existing JSON support in Apache Axis2/Java, it deals with badgerfish[1] format of the JSON object which is an XML representation of JSON object. In the server side it converts that badgerfish string to the relevant XML format and use it similarly as a normal XML SOAP message. As described in Axis2 documentation[1] it partially supports mapped format which is another XML representation of JSON object too. But this JSON support can be improved to support pure JSON objects without using any format to covert it into a XML, as JSON is a light weighted alternative to XML. Therefore existing JSON support doesn't expose its advantages at all. Here I propose a solution to improve the existing JSON support of Axis2 with some limitations by using google-gson [2] library which is a rich library to convert a JSON string to a Java object and vice-versa. As this is also released under Apache license, using this library we can improve JSON support in Axis2 to overcome above problem.