Note that there are some explanatory texts on larger screens.

plurals
  1. POWSo2 ESB 4.0.3 and JSON in REST service
    text
    copied!<p>I am trying to use a REST service spit out a JSON output in WSB403 and I have been highly unsuccessful. I followed the steps outlined from the below link.</p> <p><a href="http://docs.wso2.org/display/ESB403/ESB+and+JSON" rel="nofollow">ESB and JSON</a> </p> <p>I have added the <code>DynamicResponseModule</code> and I have it assigned globally. </p> <p>When I run the REST service normally, I get a XML formatted output as expected, but when I try to add a "<code>response=json</code>", my service times out and I get the following stacktrace. </p> <p>Internally the <code>DynamicResponseModule</code> is supposed to map this <code>responseType</code> to <code>application/JSON/Badgerfish</code> and when it does that I get the following stack trace.</p> <blockquote> <p>java.lang.RuntimeException: Element namespace from data source is <a href="http://ws.apache.org/axis2" rel="nofollow">http://ws.apache.org/axis2</a>, not the expected at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.forceExpand(OMSourcedElementImpl.java:287) at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.getFirstOMChild(OMSourcedElementImpl.java:867) at org.apache.axiom.om.impl.OMNavigator._getFirstChild(OMNavigator.java:196) at org.apache.axiom.om.impl.OMNavigator.updateNextNode(OMNavigator.java:140) at org.apache.axiom.om.impl.OMNavigator.getNext(OMNavigator.java:112) at org.apache.axiom.om.impl.SwitchingWrapper.updateNextNode(SwitchingWrapper.java:1113) at org.apache.axiom.om.impl.SwitchingWrapper.(SwitchingWrapper.java:235) at org.apache.axiom.om.impl.OMStAXWrapper.(OMStAXWrapper.java:74) at org.apache.axiom.om.impl.llom.OMStAXWrapper.(OMStAXWrapper.java:52) at org.apache.axiom.om.impl.llom.OMContainerHelper.getXMLStreamReader(OMContainerHelper.java:51) at org.apache.axiom.om.impl.llom.OMElementImpl.getXMLStreamReader(OMElementImpl.java:736) at org.apache.axiom.om.impl.llom.OMElementImpl.cloneOMElement(OMElementImpl.java:1038) at org.apache.synapse.util.MessageHelper.cloneSOAPEnvelope(MessageHelper.java:256) at org.apache.synapse.core.axis2.SOAPUtils.convertSOAP11toSOAP12(SOAPUtils.java:95) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:323) at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:160) 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.java:173) 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) These are the message formatters and builders that I have added to the axis2.xml class="org.apache.axis2.json.JSONOMBuilder"/> class="org.apache.axis2.json.JSONBadgerfishOMBuilder"/><br> class="org.apache.axis2.json.JSONOMBuilder"/> <br> class="org.apache.axis2.json.JSONBadgerfishMessageFormatter"/><br> class="org.apache.axis2.json.JSONMessageFormatter"/></p> </blockquote> <p>Any idea what am I missing here ?</p> <p>Thanks </p> <p>Narsi </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload