title: Can't parse JSON response in the OutSequence wso2 esb?
body: <p>At the start of the Outsequence I am using this:</p>
  
  <pre><code>&lt;property name="messageType" value="application/JSON" scope="axis2"/&gt;
  </code></pre>
  
  <p>but still I get the error message Content not allowed in prolog.</p>
  
  <p>If I directly send the response to the client without using any mediators I don't get any error.</p>
  
  <p>Below is the full stack trace:</p>
  
  <pre><code>[2015-07-07 12:11:35,747] ERROR - RelayUtils Error while building Passthrough stream
  org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
  Message: Content is not allowed in prolog.
          at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
          at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
          at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.&lt;init&gt;(StAXSOAPModelBuilder.java:154)
          at org.apache.axiom.om.impl.AbstractOMMetaFactory.createStAXSOAPModelBuilder(AbstractOMMetaFactory.java:73)
          at org.apache.axiom.om.impl.AbstractOMMetaFactory.createSOAPModelBuilder(AbstractOMMetaFactory.java:79)
          at org.apache.axiom.om.OMXMLBuilderFactory.createSOAPModelBuilder(OMXMLBuilderFactory.java:196)
          at org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java:55)
          at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:138)
          at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:107)
          at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:82)
          at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:68)
          at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47)
          at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131)
          at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:268)
          at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:488)
          at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:170)
          at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
          at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:225)
          at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:745)
  </code></pre>