Exception in SOAP to JSON conversion

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Exception in SOAP to JSON conversion

Piriya Sivalingam
Hi,

I am seeing an error in ESB 5.0.0 when making SOAP to JSON conversion via a proxy service. When I invoke the proxy using following curl command the operation was successful, but I could see some errors logged in the console.

When I search for the error, I found a solution given in [1]. When I try it, the error got resolved. But still, I am getting a SOAP payload as the response message.

Here is my proxy service.  

<?xml version="1.0" encoding="UTF-8"?>
       name="newproxy1.2"
       startOnLoad="true"
       statistics="disable"
       trace="disable"
       transports="http,https">
   <target>
      <inSequence>
         <header name="Authorization"
                 scope="transport"
                 value="Basic cGlyaXlhOnBpcml5YTEyMw=="/>
         <log>
            <property expression="$axis2:HTTP_METHOD" name="httpmethod === "/>
         </log>
         <switch source="$axis2:HTTP_METHOD">
            <case regex="^(.*(GET)).*$">
               <payloadFactory media-type="xml">
                  <format>
                     <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                                       xmlns:ser="http://service.sample.ninewells.com">
                        <soapenv:Header>
                           <abc>2611</abc>
                        </soapenv:Header>
                        <soapenv:Body>
                           <ser:readNinewells>
                              <ser:patientId>$1</ser:patientId>
                           </ser:readNinewells>
                        </soapenv:Body>
                     </soapenv:Envelope>
                  </format>
                  <args>
                     <arg xmlns:ns="http://org.apache.synapse/xsd"
                          evaluator="xml"
                          expression="$url:patientId"/>
                  </args>
               </payloadFactory>
               <property name="SOAPAction"
                         scope="transport"
                         type="STRING"
                         value="urn:readNinewells"/>
               <header name="Action" scope="default" value="urn:readNinewells"/>
               <property name="messageType"
                         scope="axis2"
                         type="STRING"
                         value="application/xml"/>
               <send>
                  <endpoint>
                     <address format="soap11"
                              uri="https://<IP>:<PORT>/services/NinewellsPatientService"/>
                  </endpoint>
               </send>
            </case>
            <case regex="^(.*(DELETE)).*$">
               <payloadFactory media-type="xml">
                  <format>
                     <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                                       xmlns:ser="http://service.sample.ninewells.com">
                        <soapenv:Header>
                           <abc>2611</abc>
                        </soapenv:Header>
                        <soapenv:Body>
                           <ser:deleteNinewells>
                              <ser:patientId>$1</ser:patientId>
                           </ser:deleteNinewells>
                        </soapenv:Body>
                     </soapenv:Envelope>
                  </format>
                  <args>
                     <arg xmlns:ns="http://org.apache.synapse/xsd"
                          evaluator="xml"
                          expression="$url:patientId"/>
                  </args>
               </payloadFactory>
               <property name="SOAPAction"
                         scope="transport"
                         type="STRING"
                         value="urn:deleteNinewells"/>
               <header name="Action" scope="default" value="urn:deleteNinewells"/>
               <property name="messageType"
                         scope="axis2"
                         type="STRING"
                         value="application/xml"/>
               <send>
                  <endpoint>
                     <address format="soap11"
                              uri="https://<IP>:<PORT>/services/NinewellsPatientService"/>
                  </endpoint>
               </send>
            </case>
            <default/>
         </switch>
      </inSequence>
      <outSequence>
         <property name="messageType"
                   scope="axis2"
                   type="STRING"
                   value="application/json"/>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>


The exception in the console is:

ERROR - JsonUtil #writeAsJson. Payload could not be written as JSON. MessageID: urn:uuid:752a8cd2-03a7-4564-8645-7652db5c8666
[2017-11-17 10:06:30,700] ERROR - PassThroughHttpSender Failed to submit the response
org.apache.axis2.AxisFault: Payload could not be written as JSON.
at org.apache.synapse.commons.json.JsonUtil.writeAsJson(JsonUtil.java:264)
at org.apache.synapse.commons.json.JsonStreamFormatter.writeTo(JsonStreamFormatter.java:61)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:566)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:264)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:222)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:531)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:118)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:337)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:560)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:194)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:260)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
[2017-11-17 10:06:30,702] ERROR - Axis2Sender Content-Type:application/json,<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope> Unexpected error sending message back
org.apache.axis2.AxisFault: Failed to submit the response
at org.apache.synapse.transport.passthru.PassThroughHttpSender.handleException(PassThroughHttpSender.java:624)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:266)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:222)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:531)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:118)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:337)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:560)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:194)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:260)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.axis2.AxisFault: Payload could not be written as JSON.
at org.apache.synapse.commons.json.JsonUtil.writeAsJson(JsonUtil.java:264)
at org.apache.synapse.commons.json.JsonStreamFormatter.writeTo(JsonStreamFormatter.java:61)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:566)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:264)


[1] [Dev] [ESB] JSON to SOAP conversion issue

Could you please suggest how I can overcome this issue or correct me if I am wrong?

Thanks,
Piriya
                                

--
Regards,
Piriya Sivalingam
Software Engineer - Support Team
WSO2
Mobile : +94 77 8462039

http://wso2.com/signature


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Exception in SOAP to JSON conversion

Thilini Shanika
Hi Priya,

It seems like you are getting a SOAP response with an empty body(<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope>) so that the JSON conversion fails. What is the requirement here to convert an empty SOAP message into a JSON? If you are getting an empty SOAP body for a delete operation, there's no point of converting it to a JSON, instead, you can return an HTTP status code(200).

On Fri, Nov 17, 2017 at 10:32 AM, Piriya Sivalingam <[hidden email]> wrote:
Hi,

I am seeing an error in ESB 5.0.0 when making SOAP to JSON conversion via a proxy service. When I invoke the proxy using following curl command the operation was successful, but I could see some errors logged in the console.

When I search for the error, I found a solution given in [1]. When I try it, the error got resolved. But still, I am getting a SOAP payload as the response message.

Here is my proxy service.  

<?xml version="1.0" encoding="UTF-8"?>
       name="newproxy1.2"
       startOnLoad="true"
       statistics="disable"
       trace="disable"
       transports="http,https">
   <target>
      <inSequence>
         <header name="Authorization"
                 scope="transport"
                 value="Basic cGlyaXlhOnBpcml5YTEyMw=="/>
         <log>
            <property expression="$axis2:HTTP_METHOD" name="httpmethod === "/>
         </log>
         <switch source="$axis2:HTTP_METHOD">
            <case regex="^(.*(GET)).*$">
               <payloadFactory media-type="xml">
                  <format>
                     <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                                       xmlns:ser="http://service.sample.ninewells.com">
                        <soapenv:Header>
                           <abc>2611</abc>
                        </soapenv:Header>
                        <soapenv:Body>
                           <ser:readNinewells>
                              <ser:patientId>$1</ser:patientId>
                           </ser:readNinewells>
                        </soapenv:Body>
                     </soapenv:Envelope>
                  </format>
                  <args>
                     <arg xmlns:ns="http://org.apache.synapse/xsd"
                          evaluator="xml"
                          expression="$url:patientId"/>
                  </args>
               </payloadFactory>
               <property name="SOAPAction"
                         scope="transport"
                         type="STRING"
                         value="urn:readNinewells"/>
               <header name="Action" scope="default" value="urn:readNinewells"/>
               <property name="messageType"
                         scope="axis2"
                         type="STRING"
                         value="application/xml"/>
               <send>
                  <endpoint>
                     <address format="soap11"
                              uri="https://<IP>:<PORT>/services/NinewellsPatientService"/>
                  </endpoint>
               </send>
            </case>
            <case regex="^(.*(DELETE)).*$">
               <payloadFactory media-type="xml">
                  <format>
                     <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                                       xmlns:ser="http://service.sample.ninewells.com">
                        <soapenv:Header>
                           <abc>2611</abc>
                        </soapenv:Header>
                        <soapenv:Body>
                           <ser:deleteNinewells>
                              <ser:patientId>$1</ser:patientId>
                           </ser:deleteNinewells>
                        </soapenv:Body>
                     </soapenv:Envelope>
                  </format>
                  <args>
                     <arg xmlns:ns="http://org.apache.synapse/xsd"
                          evaluator="xml"
                          expression="$url:patientId"/>
                  </args>
               </payloadFactory>
               <property name="SOAPAction"
                         scope="transport"
                         type="STRING"
                         value="urn:deleteNinewells"/>
               <header name="Action" scope="default" value="urn:deleteNinewells"/>
               <property name="messageType"
                         scope="axis2"
                         type="STRING"
                         value="application/xml"/>
               <send>
                  <endpoint>
                     <address format="soap11"
                              uri="https://<IP>:<PORT>/services/NinewellsPatientService"/>
                  </endpoint>
               </send>
            </case>
            <default/>
         </switch>
      </inSequence>
      <outSequence>
         <property name="messageType"
                   scope="axis2"
                   type="STRING"
                   value="application/json"/>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>


The exception in the console is:

ERROR - JsonUtil #writeAsJson. Payload could not be written as JSON. MessageID: urn:uuid:752a8cd2-03a7-4564-8645-7652db5c8666
[2017-11-17 10:06:30,700] ERROR - PassThroughHttpSender Failed to submit the response
org.apache.axis2.AxisFault: Payload could not be written as JSON.
at org.apache.synapse.commons.json.JsonUtil.writeAsJson(JsonUtil.java:264)
at org.apache.synapse.commons.json.JsonStreamFormatter.writeTo(JsonStreamFormatter.java:61)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:566)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:264)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:222)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:531)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:118)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:337)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:560)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:194)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:260)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
[2017-11-17 10:06:30,702] ERROR - Axis2Sender Content-Type:application/json,<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope> Unexpected error sending message back
org.apache.axis2.AxisFault: Failed to submit the response
at org.apache.synapse.transport.passthru.PassThroughHttpSender.handleException(PassThroughHttpSender.java:624)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:266)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:222)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:531)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:118)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:337)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:560)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:194)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:260)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.axis2.AxisFault: Payload could not be written as JSON.
at org.apache.synapse.commons.json.JsonUtil.writeAsJson(JsonUtil.java:264)
at org.apache.synapse.commons.json.JsonStreamFormatter.writeTo(JsonStreamFormatter.java:61)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:566)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:264)


[1] [Dev] [ESB] JSON to SOAP conversion issue

Could you please suggest how I can overcome this issue or correct me if I am wrong?

Thanks,
Piriya
                                

--
Regards,
Piriya Sivalingam
Software Engineer - Support Team
WSO2
Mobile : <a href="tel:+94%2077%20846%202039" value="+94778462039" target="_blank">+94 77 8462039

http://wso2.com/signature


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Thilini Shanika
Senior Software Engineer

WSO2, Inc.; http://wso2.com
20, Palmgrove Avenue, Colombo 3



_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Exception in SOAP to JSON conversion

Piriya Sivalingam
Hi Thilini,

Thank you for the explanation and according to Buddhimala I have added a custom response for the status code 202 and it works fine.

Thanks.
Piriya

On Mon, Nov 20, 2017 at 9:53 AM, Thilini Shanika <[hidden email]> wrote:
Hi Priya,

It seems like you are getting a SOAP response with an empty body(<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope>) so that the JSON conversion fails. What is the requirement here to convert an empty SOAP message into a JSON? If you are getting an empty SOAP body for a delete operation, there's no point of converting it to a JSON, instead, you can return an HTTP status code(200).

On Fri, Nov 17, 2017 at 10:32 AM, Piriya Sivalingam <[hidden email]> wrote:
Hi,

I am seeing an error in ESB 5.0.0 when making SOAP to JSON conversion via a proxy service. When I invoke the proxy using following curl command the operation was successful, but I could see some errors logged in the console.

When I search for the error, I found a solution given in [1]. When I try it, the error got resolved. But still, I am getting a SOAP payload as the response message.

Here is my proxy service.  

<?xml version="1.0" encoding="UTF-8"?>
       name="newproxy1.2"
       startOnLoad="true"
       statistics="disable"
       trace="disable"
       transports="http,https">
   <target>
      <inSequence>
         <header name="Authorization"
                 scope="transport"
                 value="Basic cGlyaXlhOnBpcml5YTEyMw=="/>
         <log>
            <property expression="$axis2:HTTP_METHOD" name="httpmethod === "/>
         </log>
         <switch source="$axis2:HTTP_METHOD">
            <case regex="^(.*(GET)).*$">
               <payloadFactory media-type="xml">
                  <format>
                     <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                                       xmlns:ser="http://service.sample.ninewells.com">
                        <soapenv:Header>
                           <abc>2611</abc>
                        </soapenv:Header>
                        <soapenv:Body>
                           <ser:readNinewells>
                              <ser:patientId>$1</ser:patientId>
                           </ser:readNinewells>
                        </soapenv:Body>
                     </soapenv:Envelope>
                  </format>
                  <args>
                     <arg xmlns:ns="http://org.apache.synapse/xsd"
                          evaluator="xml"
                          expression="$url:patientId"/>
                  </args>
               </payloadFactory>
               <property name="SOAPAction"
                         scope="transport"
                         type="STRING"
                         value="urn:readNinewells"/>
               <header name="Action" scope="default" value="urn:readNinewells"/>
               <property name="messageType"
                         scope="axis2"
                         type="STRING"
                         value="application/xml"/>
               <send>
                  <endpoint>
                     <address format="soap11"
                              uri="https://<IP>:<PORT>/services/NinewellsPatientService"/>
                  </endpoint>
               </send>
            </case>
            <case regex="^(.*(DELETE)).*$">
               <payloadFactory media-type="xml">
                  <format>
                     <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                                       xmlns:ser="http://service.sample.ninewells.com">
                        <soapenv:Header>
                           <abc>2611</abc>
                        </soapenv:Header>
                        <soapenv:Body>
                           <ser:deleteNinewells>
                              <ser:patientId>$1</ser:patientId>
                           </ser:deleteNinewells>
                        </soapenv:Body>
                     </soapenv:Envelope>
                  </format>
                  <args>
                     <arg xmlns:ns="http://org.apache.synapse/xsd"
                          evaluator="xml"
                          expression="$url:patientId"/>
                  </args>
               </payloadFactory>
               <property name="SOAPAction"
                         scope="transport"
                         type="STRING"
                         value="urn:deleteNinewells"/>
               <header name="Action" scope="default" value="urn:deleteNinewells"/>
               <property name="messageType"
                         scope="axis2"
                         type="STRING"
                         value="application/xml"/>
               <send>
                  <endpoint>
                     <address format="soap11"
                              uri="https://<IP>:<PORT>/services/NinewellsPatientService"/>
                  </endpoint>
               </send>
            </case>
            <default/>
         </switch>
      </inSequence>
      <outSequence>
         <property name="messageType"
                   scope="axis2"
                   type="STRING"
                   value="application/json"/>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>


The exception in the console is:

ERROR - JsonUtil #writeAsJson. Payload could not be written as JSON. MessageID: urn:uuid:752a8cd2-03a7-4564-8645-7652db5c8666
[2017-11-17 10:06:30,700] ERROR - PassThroughHttpSender Failed to submit the response
org.apache.axis2.AxisFault: Payload could not be written as JSON.
at org.apache.synapse.commons.json.JsonUtil.writeAsJson(JsonUtil.java:264)
at org.apache.synapse.commons.json.JsonStreamFormatter.writeTo(JsonStreamFormatter.java:61)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:566)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:264)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:222)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:531)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:118)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:337)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:560)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:194)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:260)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
[2017-11-17 10:06:30,702] ERROR - Axis2Sender Content-Type:application/json,<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope> Unexpected error sending message back
org.apache.axis2.AxisFault: Failed to submit the response
at org.apache.synapse.transport.passthru.PassThroughHttpSender.handleException(PassThroughHttpSender.java:624)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:266)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:222)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:531)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:118)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:337)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:560)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:194)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:260)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.axis2.AxisFault: Payload could not be written as JSON.
at org.apache.synapse.commons.json.JsonUtil.writeAsJson(JsonUtil.java:264)
at org.apache.synapse.commons.json.JsonStreamFormatter.writeTo(JsonStreamFormatter.java:61)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:566)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:264)


[1] [Dev] [ESB] JSON to SOAP conversion issue

Could you please suggest how I can overcome this issue or correct me if I am wrong?

Thanks,
Piriya
                                

--
Regards,
Piriya Sivalingam
Software Engineer - Support Team
WSO2
Mobile : <a href="tel:+94%2077%20846%202039" value="+94778462039" target="_blank">+94 77 8462039

http://wso2.com/signature


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Thilini Shanika
Senior Software Engineer

WSO2, Inc.; http://wso2.com
20, Palmgrove Avenue, Colombo 3





--
Regards,
Piriya Sivalingam
Software Engineer - Support Team
WSO2
Mobile : +94 77 8462039

http://wso2.com/signature


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev