Take the 2-minute tour ×

I am trying to build a simple POC using wso2ESB. I've created a simple pass through proxy service with an Alfresco service http://www.alfresco.com/

The problem is I am not getting the full JSON data. I've read it has something to do with the axis2-JSON and that it causes problems when one has JSONArray in the root. So I've decided to use message relay.

WSO2 ESB Unable to convert complete JSON data to XML

I've edited the axis2.xml as described in the documentation thus adding the following lines

<messageFormatter contentType="application/json"


<messageBuilder contentType="application/xml"

But after I've restarted the server when I try to use the proxy server through the firefox REST plugin the ESB throws the following exception

    [2012-07-12 10:02:29,125]  WARN - ClientWorker Unexpected response received. HTTP response co
de : 405 HTTP status : Method Not Allowed exception : SOAP message MUST NOT contain a Documen
t Type Declaration(DTD)
[2012-07-12 10:02:29,125] ERROR - NativeWorkerPool Uncaught exception
java.lang.ClassCastException: org.apache.axiom.om.impl.llom.OMTextImpl cannot be cast to org.
        at org.apache.synapse.util.MessageHelper.cloneSOAPFault(MessageHelper.java:441)
        at org.apache.synapse.util.MessageHelper.cloneSOAPEnvelope(MessageHelper.java:254)
        at org.apache.synapse.core.axis2.SOAPUtils.convertSOAP11toSOAP12(SOAPUtils.java:95)
        at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbac
        at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackRecei
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
        at org.apache.synapse.transport.nhttp.ClientWorker.run(ClientWorker.java:275)
        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.ja
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

What causes this? Is the problem that ESB still tries to convert the JSON object instead of trying to relay it?

Is there another workaround in parsing these JSON objects (i.e. adding artificial root to the JSON object?)

share|improve this question

1 Answer 1

up vote 1 down vote accepted

at the builders you need to set the application/json to use org.wso2.carbon.relay.BinaryRelayBuilder as well.

share|improve this answer

Your Answer


