Hi,
What exact error message do you have?

Also please try to send JSON request using Poster plugin in firefox (specify 
content-type application/json/badgerfish)

From: Hans De Clercq [mailto:hans.de.cle...@aristomusic.com]
Sent: Monday, October 03, 2011 12:41 PM
To: java-user@axis.apache.org
Subject: Re: [AXIS2] Problem: Sending JSON messages to a SOAP Web service using 
Axis2

Hi,

thanks for the answer.

I've built the source file you attached and added it to axis2.xml, but still, 
the problem remains!

Op 29/09/2011 12:06, Hodchenkov, Paul schreef:
Hi,
Please find the source attached. Compile it and add to axis2.xml instead of 
default badgerfish builder.

From: Hans De Clercq [mailto:hans.de.cle...@aristomusic.com]
Sent: Thursday, September 29, 2011 12:43 PM
To: java-user@axis.apache.org<mailto:java-user@axis.apache.org>
Subject: Re: [AXIS2] Problem: Sending JSON messages to a SOAP Web service using 
Axis2

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/


--
[cid:image001.jpg@01CC81CA.89C04D80]
Met vriendelijke groeten I Hans De Clercq I R&D
Aristo Music NV I Interleuvenlaan 15 F I  B - 3001 Heverlee I + 32 498 301007 I 
www.tunify.com<http://www.tunify.com/>

FOLLOW US ON :
[cid:image002.gif@01CC81CA.89C04D80]<http://www.twitter.com/tunify>
[cid:image003.gif@01CC81CA.89C04D80]<http://www.facebook.com/tunify>

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






---------------------------------------------------------------------

To unsubscribe, e-mail: 
java-user-unsubscr...@axis.apache.org<mailto:java-user-unsubscr...@axis.apache.org>

For additional commands, e-mail: 
java-user-h...@axis.apache.org<mailto:java-user-h...@axis.apache.org>

--
[cid:image001.jpg@01CC81CA.89C04D80]
Met vriendelijke groeten I Hans De Clercq I R&D
Aristo Music NV I Interleuvenlaan 15 F I  B - 3001 Heverlee I + 32 498 301007 I 
www.tunify.com<http://www.tunify.com/>

FOLLOW US ON :
[cid:image002.gif@01CC81CA.89C04D80]<http://www.twitter.com/tunify>
[cid:image003.gif@01CC81CA.89C04D80]<http://www.facebook.com/tunify>

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

<<inline: image001.jpg>>

<<inline: image002.gif>>

<<inline: image003.gif>>

Reply via email to