Format="soap11" throwing an error in wso2 Esb and Dss

908 views Asked by At

Am working with wso2esb 4.7.0 and wso2dss 3.0.0.

I generally use Format="soap11" in the endpoint url in all my services

I have created a proxy and its sequences were it inserts data into the tables as shown below

Proxy service

  <proxy xmlns="http://ws.apache.org/ns/synapse"
   name="TicketInsertionMobileNew2.0"
   transports="https http"
   startOnLoad="true"
   trace="disable">
<description/>
<target>
  <inSequence onError="fault">
     <property name="messageType" value="application/json"     scope="axis2"/>
     <property name="ClientId"
               expression="//ClientId/text()"
               scope="default"
               type="STRING"/>
     <property name="uuid"
               expression="//uuid/text()"
               scope="default"
               type="STRING"/>
     <property name="deviceid"
               expression="//deviceid/text()"
               scope="default"
               type="STRING"/>
     <property name="todoname"
               expression="//TicketSubject/text()"
               scope="default"
               type="STRING"/>
     <property name="tododetails"
               expression="//TicketText/text()"
               scope="default"
               type="STRING"/>
     <property name="PartyBranchId"
               expression="//PartyBranchId/text()"
               scope="default"
               type="STRING"/>
     <property name="AssignedtoRoleId"
               expression="//AssignedtoRoleID/text()"
               scope="default"
               type="STRING"/>
     <property name="AssignedtoUserId"
               expression="//AssignedtoUserID/text()"
               scope="default"
               type="STRING"/>
     <property name="AssignedtoUsergroupId"
               expression="//AssignedtoUsergroupID/text()"
               scope="default"
               type="STRING"/>
     <property name="Tags"
               expression="//tags/text()"
               scope="default"
               type="STRING"/>
     <property name="CreatedById"
               expression="//TicketCreator/text()"
               scope="default"
               type="STRING"/>
     <property name="Time"
               expression="get-property('SYSTEM_TIME')"
               scope="default"
               type="STRING"/>
     <property name="FORCE_ERROR_ON_SOAP_FAULT" value="true"/>
     <property name="username" expression="get-property('transport', 'username')"/>
     <property name="password" expression="get-property('transport', 'password')"/>
     <property name="PartyBranchID"
               expression="//FieldValue/text()"
               scope="default"
               type="STRING"/>
     <property name="usercode"
               expression="fn:substring-before(get-property('username'),'|')"
               scope="default"
               type="STRING"/>
     <property name="clientid"
               expression="fn:substring-after(get-property('username'),'|')"
               scope="default"
               type="STRING"/>

     <log level="custom">
        <property name="LogLocation" value="TicketInsertionMobileNew2.0"/>

     </log>
     <payloadFactory>
        <format>
           <send xmlns="">
              <username>$1</username>
              <password>$2</password>
           </send>
        </format>
        <args>
           <arg evaluator="xml" expression="get-property('username')"/>
           <arg evaluator="xml" expression="get-property('password')"/>
        </args>
     </payloadFactory>
     <send receive="TicketInsertionMobile_Seq2.0">
        <endpoint>
           <address uri="http://localhost:8282/services/Login2.0" format="soap11">
              <suspendOnFailure>
                 <errorCodes>101500,101501,101506,101507,101508,101503,50000</errorCodes>
                 <initialDuration>30</initialDuration>
                 <progressionFactor>1.0</progressionFactor>
                 <maximumDuration>300</maximumDuration>
              </suspendOnFailure>
           </address>
        </endpoint>
     </send>
    </inSequence>
    <outSequence/>
    </target>
   </proxy>

Sequence1:

    <sequence xmlns="http://ws.apache.org/ns/synapse"
      name="TicketInsertionMobile_Seq31.0"
      onError="fault">
<property name="messageType" value="application/json" scope="axis2"/>
<property name="FORCE_ERROR_ON_SOAP_FAULT" value="true"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
         name="Authentication"
         expression="//Authentication/text()"/>
<switch xmlns:ns="http://org.apache.synapse/xsd"
       source="boolean(get-property('Authentication'))">
  <case regex="get-property(&amp;apos;Authentication&amp;apos;)=&amp;apos;TRUE&amp;apos;"/>
</switch>
<log level="custom">
  <property name="LogLocation" value="TicketInsertionMobile_Seq3.0"/>
  <property name="ProxyName" value="TicketInsertionMobileNew3.0"/>
  <property xmlns:ns="http://org.apache.synapse/xsd"
            name="Authentication"
            expression="get-property('Authentication')"/>
  <property xmlns:ns="http://org.apache.synapse/xsd"
            name="Clientid"
            expression="get-property('clientid')"/>
  <property xmlns:ns="http://org.apache.synapse/xsd"
            name="requestMsgId"
            expression="get-property('requestMsgId')"/>
</log>
<filter xmlns:ns="http://org.apache.synapse/xsd"
       xpath="get-property('Authentication')='false'">
  <then>
     <payloadFactory>
        <format>
           <ResponseJSON xmlns="">
              <Exception>Authentication Failed</Exception>
              <Status>101503</Status>
           </ResponseJSON>
        </format>
        <args/>
     </payloadFactory>
     <property name="HTTP_METHOD" value="POST" scope="axis2" type="STRING"/>
     <property name="RESPONSE" value="true" scope="default" type="STRING"/>
     <property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
     <send/>
   </then>
   <else>
     <payloadFactory media-type="xml">
        <format>
           <p:select_objectid_op xmlns:p="http://ws.wso2.org/dataservice">
              <p:uuid>$1</p:uuid>
           </p:select_objectid_op>
        </format>
        <args>
           <arg evaluator="xml" expression="get-property('uuid')"/>
        </args>
     </payloadFactory>
     <send receive="TicketInsertionMobile_Seq33.0">
        <endpoint>
           <address uri="http://localhost:9764/services/ttodo_DataServiceNew3.0/"
                    format="soap11">
              <suspendOnFailure>
                 <errorCodes>101500,101501,101506,101507,101508,101503,50000</errorCodes>
                 <initialDuration>30</initialDuration>
                 <progressionFactor>1.0</progressionFactor>
                 <maximumDuration>300</maximumDuration>
              </suspendOnFailure>
           </address>
        </endpoint>
     </send>
  </else>
 </filter>
 </sequence>

Sequence2:

      <sequence xmlns="http://ws.apache.org/ns/synapse"
      name="TicketInsertionMobile_Seq33.0"
      onError="fault">
<property name="messageType" value="application/json" scope="axis2"/>
<property name="FORCE_ERROR_ON_SOAP_FAULT" value="true"/>
<property xmlns:f="http://ws.wso2.org/dataservice"
         xmlns:ns="http://org.apache.synapse/xsd"
         name="objectid"
         expression="//f:Entry/f:objectid/text()"/>
<log level="custom">
  <property name="LogLocation" value="TicketInsertionMobile_Seq3.0"/>
  <property name="ProxyName" value="TicketInsertionMobileNew3.0"/>
  <property xmlns:ns="http://org.apache.synapse/xsd"
            name="objectid"
            expression="get-property('objectid')"/>
  <property xmlns:ns="http://org.apache.synapse/xsd"
            name="Clientid"
            expression="get-property('clientid')"/>
  <property xmlns:ns="http://org.apache.synapse/xsd"
            name="requestMsgId"
            expression="get-property('requestMsgId')"/>
</log>
<filter xmlns:ns="http://org.apache.synapse/xsd"
       xpath="get-property('objectid')=''">
  <then>
     <payloadFactory media-type="xml">
        <format>
           <p:insert_into_ttodo_seenuuid_op xmlns:p="http://ws.wso2.org/dataservice">
              <p:clientid>$1</p:clientid>
              <p:referencenumber>-1</p:referencenumber>
              <p:referencedate>$2</p:referencedate>
              <p:todoname>-$3</p:todoname>
              <p:tododetails>$4</p:tododetails>
              <p:activityid>-1</p:activityid>
              <p:ouid>-1</p:ouid>
              <p:partybranchid>$5</p:partybranchid>
              <p:assetactivityid>-1</p:assetactivityid>
              <p:todoplandate>$6</p:todoplandate>
              <p:todoplanduration>-1</p:todoplanduration>
              <p:assignedtoroleid>$7</p:assignedtoroleid>
              <p:assignedtouserid>$8</p:assignedtouserid>
              <p:assignedtousergroupid>$9</p:assignedtousergroupid>
              <p:tags>$10</p:tags>
              <p:createdbyid>$11</p:createdbyid>
              <p:modifiedbyid>$12</p:modifiedbyid>
              <p:todotype>1</p:todotype>
              <p:todostatus>5</p:todostatus>
              <p:uuid>$13</p:uuid>
              <p:deviceid>$14</p:deviceid>
           </p:insert_into_ttodo_seenuuid_op>
        </format>
        <args>
           <arg evaluator="xml" expression="get-property('ClientId')"/>
           <arg evaluator="xml" expression="get-property('Time')"/>
           <arg evaluator="xml" expression="get-property('todoname')"/>
           <arg evaluator="xml" expression="get-property('tododetails')"/>
           <arg evaluator="xml" expression="get-property('PartyBranchId')"/>
           <arg evaluator="xml" expression="get-property('Time')"/>
           <arg evaluator="xml" expression="get-property('AssignedtoRoleId')"/>
           <arg evaluator="xml" expression="get-property('AssignedtoUserId')"/>
           <arg evaluator="xml" expression="get-property('AssignedtoUsergroupId')"/>
           <arg evaluator="xml" expression="get-property('Tags')"/>
           <arg evaluator="xml" expression="get-property('CreatedById')"/>
           <arg evaluator="xml" expression="get-property('CreatedById')"/>
           <arg evaluator="xml" expression="get-property('uuid')"/>
           <arg evaluator="xml" expression="get-property('deviceid')"/>
        </args>
     </payloadFactory> 

  <property name="HTTP_METHOD" value="POST" scope="axis2" type="STRING"/>
     <property name="RESPONSE" value="true" scope="default" type="STRING"/>
     <property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
     <send receive="TicketInsertionMobile_Seq32.0">
        <endpoint>
    <address uri="http://localhost:9764/services/ttodo_DataServiceNew3.0/" format="soap11">
             <suspendOnFailure>
                 <errorCodes>101500,101501,101506,101507,101508,101503,50000</errorCodes>
                 <initialDuration>30</initialDuration>
                 <progressionFactor>1.0</progressionFactor>
                 <maximumDuration>300</maximumDuration>
              </suspendOnFailure>
          </address>
        </endpoint>
     </send>
  </then>
  <else>
     <payloadFactory media-type="xml">
        <format>
           <ResponseJSON xmlns="">
              <Exception>Data Insertion Failed Due To Objectid Already Existing</Exception>
              <Status>101503</Status>
           </ResponseJSON>
        </format>
        <args/>
     </payloadFactory>
     <property name="HTTP_METHOD" value="POST" scope="axis2" type="STRING"/>
     <property name="RESPONSE" value="true" scope="default" type="STRING"/>
     <property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
     <send/>
  </else>

so when i call this proxy the insertion is not happening and my ESB is showing the following error

    SequenceMediator Error while building message
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </body>; expected </HR>.
at [row,col {unknown-source}]: [20,187]
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
at org.apache.axiom.om.impl.llom.OMSerializableImpl.build(OMSerializableImpl.java:78)
at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:722)
at org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:700)
at org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:105)
at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:296)
at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:212)
at org.apache.axiom.soap.impl.llom.SOAPBodyImpl.addChild(SOAPBodyImpl.java:231)
at org.apache.axis2.transport.TransportUtils.createSOAPEnvelope(TransportUtils.java:161)
at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:121)
at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:91)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:62)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:232)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:443)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:166)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:222)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:701)
Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </body>; expected </HR>.
at [row,col {unknown-source}]: [20,187]
at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:606)
at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:479)
at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:464)
at com.ctc.wstx.sr.BasicStreamReader.reportWrongEndElem(BasicStreamReader.java:3260)
at com.ctc.wstx.sr.BasicStreamReader.readEndElem(BasicStreamReader.java:3187)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2806)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1062)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
... 21 more

And in wso2 dss as shown below

PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [bridgeservlet] in context with path [/] threw exception
java.lang.NullPointerException
at   org.wso2.carbon.tracer.module.handler.AbstractTracingHandler.storeMessage(AbstractTracingHandler.java:81)
at  org.wso2.carbon.tracer.module.handler.TracingMessageOutObservationHandler.    invoke(TracingMessageOutObservationHandler.java:73)
at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262)
at org.apache.axis2.engine.AxisEngine.sendFault(AxisEngine.java:516)
at org.apache.axis2.transport.http.AxisServlet.handleFault(AxisServlet.java:433)
at org.apache.axis2.transport.http.AxisServlet.processAxisFault(AxisServlet.java:398)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:188)
at org.wso2.carbon.core.transports.CarbonServlet.doPost(CarbonServlet.java:231)

But if i remove the format="soap11" from the addressurl in sequence2 then the process get successful an data is inserted into the table.

Please help me know why this error is occurring why exactly this Format="soap11" causing a problem.

0

There are 0 answers