Hi Anjana et al,
Above new JSON implementation has been introduced to handle XML <--> JSON
lossless transformation. and this implementation highly depend on the
schema definitions, where it generate the message structure by reading this
schemas. In short, to work XML stream base JSON implementation we need to
have proper schema definition for in and out messages otherwise it won't
work.
Addition to the above entries we need to do following changes to axis2.xml
file in order to integrate above implementation.
Remove RequestURIOperationDispatcher handler from dispatch phase and place
it as the last handler in transport phase. IMO it is ok to move
RequestURIOperationDispatcher to transport phase as we are dealing with
URI.
Now add new JSONMessageHandler after the RequestURIOperationDispatcher.
Finally transport phase would be like following
<phaseOrder type="InFlow">
<!-- System predefined phases -->
<phase name="Transport">
-------------
<handler name="RequestURIOperationDispatcher"
class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
<handler name="JSONMessageHandler"
class="org.apache.axis2.json.gson.JSONMessageHandler" />
</phase>
------------
</phaseOrder>
Thanks,
Shameera.
On Tue, Mar 18, 2014 at 1:40 PM, Anjana Fernando <[email protected]> wrote:
> Hi,
>
> We've added JSON mapping support for DSS, which is mentioned in the mail
> with subject "JSON Mapping Support for Data Services". For this, I've used
> the GSON based streaming JSON message builder/formatter, where this was
> needed for a correct JSON message generation by looking at the service
> schema. There were some fixes done by Shameera lately, and this is working
> properly now for all of the scenarios I've tested. So shall we ship this
> message builder/formatter by default from the axis2.xml in the kernel, so
> all the products, including AS and DSS will get this feature. It will be
> specifically required by AS, as it still contains the data services
> features.
>
> And for ESB, I'm not sure how the new message builder/formatter would
> work, since they will not always have correct service schemas in proxy
> services etc.. so I guess those scenarios may fail, maybe Shameera can give
> some insight on this more. Anyways, the ESB has their own axis2.xml, so
> they will not be affected.
>
> So shall we go ahead in updating the kernel's axis2.xml to contain the
> following sections? ..
>
> <messageFormatter contentType="application/json"
> class="org.apache.axis2.json.gson.JsonFormatter" />
>
> <messageBuilder contentType="application/json"
> class="org.apache.axis2.json.gson.JsonBuilder" />
>
> Cheers,
> Anjana
> --
> *Anjana Fernando*
> Technical Lead
> WSO2 Inc. | http://wso2.com
> lean . enterprise . middleware
>
--
*Software Engineer - WSO2 Inc.*
*email: shameera AT wso2.com <[email protected]> , shameera AT apache.org
<[email protected]>*
*phone: +9471 922 1454*
*Linked in : *http://lk.linkedin.com/pub/shameera-rathnayaka/1a/661/561
*Twitter : *https://twitter.com/Shameera_R
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture