Hi,

I suppose you mean JSONBadgerfishOMBuilder ?

is it possible to send me a modified jar ?
Or explain how I can modify JSONBadgerfishOMBuilder and what the whole processDocument method looks like?

Thanks!

Op 28/09/2011 15:21, Hodchenkov, Paul schreef:

Hi,

According to this [1], you can’t use JSON with RPCMessageReceiver.

I modified JSONBadgerfishBuilder to handle this case by converting JSON/Badgerfish explicitly to SOAP:

public OMElement processDocument(InputStream inputStream, String contentType,

                                     MessageContext messageContext) throws AxisFault {

….

    AbstractXMLInputFactory inputFactory = createFactory();

            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();

 

}

 

[1] http://isurues.wordpress.com/2009/10/06/how-to-use-axis2-json/



--

Met vriendelijke groeten I Hans De Clercq I R&D

Aristo Music NV I Interleuvenlaan 15 F I  B - 3001 Heverlee + 32 498 301007 www.tunify.com

 

FOLLOW US ON : 

Twitter  
Facebook

 

CONFIDENTIALITY: This email (including any attachments) may contain confidential, proprietary and privileged information, and unauthorized disclosure or use is prohibited. If you received this email in error, please notify the sender and delete this email from your system

Reply via email to