Return-Path: X-Original-To: apmail-axis-java-dev-archive@www.apache.org Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 04FD79972 for ; Mon, 30 Apr 2012 21:18:17 +0000 (UTC) Received: (qmail 91401 invoked by uid 500); 30 Apr 2012 21:18:14 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 91263 invoked by uid 500); 30 Apr 2012 21:18:14 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 91230 invoked by uid 99); 30 Apr 2012 21:18:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Apr 2012 21:18:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Apr 2012 21:18:12 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id C58384281BE for ; Mon, 30 Apr 2012 21:17:52 +0000 (UTC) Date: Mon, 30 Apr 2012 21:17:52 +0000 (UTC) From: "Andreas Veithen (JIRA)" To: java-dev@axis.apache.org Message-ID: <1236419902.10931.1335820672810.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1217304338.2190.1317625714055.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Assigned] (AXIS2-5158) Improve JSON support in Axis2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AXIS2-5158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andreas Veithen reassigned AXIS2-5158: -------------------------------------- Assignee: Andreas Veithen > 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