[
https://issues.apache.org/jira/browse/AXIS2-5270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13230952#comment-13230952
]
Sagara Gunathunga commented on AXIS2-5270:
-------------------------------------------
I will provide detailed review later following are some of my obvious
observations.
1.) At the moment your JsonRpcMessageReceiver only work with JSON messages but
services should be accessed by both XML and JSON payloads. What you can do here
is set a boolean property to the MessageContext in the JsonBuilder class and
check that property in the JsonRpcMessageReceiver#invokeBusinessLogic method
if the value is not set of false then you can assume request is not JSON and
should fullback to use super class's invokeBusinessLogic method.
2.) Processing fail if I use endpoint address up to service level ( e.g -
http://localhost:8080/axis2/services/JsonTestService) without operation part.
Considering non HTTP transports we need to address this issue too.
May be you could use wrapper JSON element ( e.g - EchoStudent ? ) to dispatch
operation. This is required to read first element from JSON stream before
unmarshaling. I'm not sure about feasibility of this idea but you can do a POC
on this.
> Improve Json support in Axis2 with google-gson
> ----------------------------------------------
>
> Key: AXIS2-5270
> URL: https://issues.apache.org/jira/browse/AXIS2-5270
> Project: Axis2
> Issue Type: Improvement
> Components: json
> Affects Versions: 1.7.0
> Reporter: Shameera Rathnayaka
> Assignee: Shameera Rathnayaka
> Labels: gsoc2012, gson, json
> Fix For: 1.7.0
>
> Attachments: attachments.zip
>
>
> There are two ways that xml string can be converted into JSON string,
> Badgerfish and Mapped . Current Axis2 with JSON module completely supports
> Badgerfish convention[1] while partialy supports Mapped convention[1] as
> Mapped formatted JSON with namespaces are not supported in Axis2. Therefore
> if the client side java-script code needs to talk with java service which is
> deployed in Axis2, it should be sent as Badgerfish convention. It is
> cumbersome to generate Badgerfish convention of JSON string again and again
> to call services if there is no xml representation string in client side.
> If java script client can send JSON object to relevant java service in Axis2,
> defining service and operation in request url, without doing any
> modifications to JSON objects, then it would be very helpful for Java-Script
> users at client side.
> According to the thread in the mailing list, which discussed $subject we have
> two approaches. i have summarized those two approaches as below.
> 1. Store json inputstream in message context at the message builder while
> putting dummy SOAPEnvelop to the message context, and using google-gson
> process it inside the message receiver
> 2. Preserve the requirement that a message must have a well defined SOAP
> infoset and use a trivial representation similar (or identical) to what we
> use for plain text. This has the advantage that it is more in line with the
> rest of the Axis2 architecture,
> or
> another option is to write an xmlstream reader/writer implementation to
> parse the json stream. And provide that xml stream implementation to Axiom.
> [1]http://wso2.org/library/768
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]