axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AXIS2-5158) Improve JSON support in Axis2
Date Mon, 30 Apr 2012 22:51:49 GMT

    [ https://issues.apache.org/jira/browse/AXIS2-5158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13265470#comment-13265470
] 

Hudson commented on AXIS2-5158:
-------------------------------

Integrated in Axis2 #1412 (See [https://builds.apache.org/job/Axis2/1412/])
    Improving the JSON code - Step 2 - Instead of using some hacks to extract the name of
the element, just let Axiom determine it lazily using the feature introduced by AXIOM-399.

This should make databindings work with Badgerfish (although we have no integration test for
this yet) and solve AXIS2-5158, AXIS2-5295 and AXIS2-5300. (Revision 1332402)

     Result = SUCCESS
veithen : 
Files : 
* /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java
* /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/AbstractJSONOMBuilder.java
* /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/JSONBadgerfishDataSource.java
* /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/JSONBadgerfishMessageFormatter.java
* /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/JSONBadgerfishOMBuilder.java
* /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/JSONDataSource.java
* /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/JSONMessageFormatter.java
* /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/JSONOMBuilder.java
* /axis/axis2/java/core/trunk/modules/json/test/org/apache/axis2/json/JSONDataSourceTest.java
* /axis/axis2/java/core/trunk/modules/json/test/org/apache/axis2/json/JSONOMBuilderTest.java

                
> Improve JSON support in Axis2
> -----------------------------
>
>                 Key: AXIS2-5158
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5158
>             Project: Axis2
>          Issue Type: Improvement
>          Components: json
>    Affects Versions: 1.6.1
>            Reporter: Paul Hodchenkov
>            Assignee: Andreas Veithen
>         Attachments: AbstractJSONBuilder.java, AbstractJSONMessageFormatter.java, ExtendedMappedXMLStreamWriter.java,
JSONBadgerfishBuilder.java, JSONBadgerfishMessageFormatter.java, JSONMappedBuilder.java, JSONMessageFormatter.java
>
>
> RawXMLInOutMessageReceiver can be only used in JSON services now [1].
> However, JSON/badgerfish builder can be improved by handling RPCMessageReceiver correctly.
I can't attach the patch because i have copy pasted and created my own formatters and builders(please
find the source attached):
> 1) It is possible to solve the namespace problem described at [1] by explicitly converting
JSON/badgerfish to SOAP in JSONbadgerfish builder :
> public OMElement processDocument(InputStream inputStream, String contentType,
> MessageContext messageContext) throws AxisFault {
> ....
> AbstractXMLInputFactory inputFactory = new BadgerFishXMLInputFactory();
> XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(
> new JSONTokener(IOUtils.toString(reader)));
> OMNodeEx document = (OMNodeEx) new StAXOMBuilder(xmlReader).getDocumentElement();
> //removing parent
> document.setParent(null);
> //wrapping document with envelope
> SOAPFactory soapFactory = OMAbstractFactory.getSOAP11Factory();
> SOAPEnvelope soapEnvelope = soapFactory.getDefaultEnvelope();
> SOAPBody body = soapEnvelope.getBody();
> body.addChild(document);
> soapEnvelope.build();
>  //converting xml structure to soap xml structure,
> //this operation will construct SoapEnvelope,SoapBody,SoapFault instead of
> //regular OmElement
> StAXSOAPModelBuilder stAXSOAPModelBuilder = new StAXSOAPModelBuilder(soapEnvelope.getXMLStreamReader(),
null);
> return stAXSOAPModelBuilder.getSOAPEnvelope();
> ...
> }
> 2) jettison 1.2 has cool feature called setIgnoreNamespaces which allows to use json
formatter with any xml.
> We use the these builders and formatters successfully with JSON/badgerfish request and
JSON response.
> [1] http://isurues.wordpress.com/2009/10/06/how-to-use-axis2-json/

--
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: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message