我如何在未将响应传递给客户端的 Wso2ESB 中处理此问题 [英] How can i handle this in Wso2ESB which is not passing Respone to Client

查看:29
本文介绍了我如何在未将响应传递给客户端的 Wso2ESB 中处理此问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在插入多个表,其中一些是直接插入,还有一些是我们需要拆分,这意味着使用迭代中介器,我已经使用两个代理完成并添加故障序列,如果我的 DSS 关闭,则插入也可以,它正在正确传递客户端的错误.问题是当 dss 中出现错误时,像这样 ..primarykey voilation 我添加了这个属性 <property name="FORCE_ERROR_ON_SOAP_FAULT" value="true"/> 甚至在每个序列中虽然它像这个错误一样抛出

i am inserting in multiple table some of those is directly insertion and some more is we need split it means use iterate mediator i have done using two proxy and add fault sequence also insertion is ok if my DSS is down it is passing proper fault to client .the problem is when error occuers in dss like ..primarykey voilation like this i added this property <property name="FORCE_ERROR_ON_SOAP_FAULT" value="true"/> in every sequence even though its throwing like this error

 ERROR - NativeWorkerPool Uncaught exception
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxParsingException: Illegal processing instruction target ("xml"); xml (case insensitive) is reserved by the specs.
 at [row,col {unknown-source}]: [1,167]

它给出了像上面这样的 ESB 端错误,我附上了我的错误序列 ..

and its giving ESB side error like above i am attaching my fault sequence ..

<sequence xmlns="http://ws.apache.org/ns/synapse" name="fault">
   <property xmlns:ns="http://org.apache.synapse/xsd" name="actionid" expression="get-property('actionid')"/>
   <property xmlns:ns="http://org.apache.synapse/xsd" name="actiondetailid" expression="get-property('actiondetailid')"/>
   <dbreport>
      <connection>
         <pool>
            <password>Youtility11</password>
            <user>youtilitydba</user>
            <url>jdbc:postgresql://localhost:5432/USCProduction</url>
            <driver>org.postgresql.Driver</driver>
         </pool>
      </connection>
      <statement>
         <sql>
            <![CDATA[                                                                                    delete from tactiondetail where actiondetailid=?]]></sql>
            <parameter xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('actiondetailid')" type="BIGINT"/>
         </statement>
      </dbreport>
      <log level="full"/>
      <dbreport>
         <connection>
            <pool>
               <password>Youtility11</password>
               <user>youtilitydba</user>
               <url>jdbc:postgresql://localhost:5432/USCProduction</url>
               <driver>org.postgresql.Driver</driver>
            </pool>
         </connection>
         <statement>
            <sql>
               <![CDATA[                                                                                                         delete from tactiondetail where actionid=?]]></sql>
               <parameter xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('actionid')" type="BIGINT"/>
            </statement>
         </dbreport>
         <log>
            <property name="MESSAGE" value="Executing default 'fault' sequence"/>
            <property xmlns:ns="http://org.apache.synapse/xsd" name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
            <property xmlns:ns="http://org.apache.synapse/xsd" name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
         </log>
         <switch xmlns:ns="http://org.apache.synapse/xsd" source="get-property('ERROR_CODE')">
            <case regex="500000">
               <property name="ERROR_MESSAGE" value="duplicate key value violates or The system is attempting to access an inactive service " scope="default" type="STRING"/>
            </case>
            <case regex="101503">
               <property name="ERROR_MESSAGE" value="Error connecting to the back end" scope="default" type="STRING"/>
            </case>
         </switch>
         <payloadFactory>
            <format>
               <ResponseJSON xmlns="">
                  <Exception>$1</Exception>
                  <Status>$2</Status>
                  <Total>0</Total>
               </ResponseJSON>
            </format>
            <args>
               <arg xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('ERROR_MESSAGE')"/>
               <arg xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('ERROR_CODE')"/>
            </args>
         </payloadFactory>
         <header name="To" action="remove"/>
         <property name="RESPONSE" value="true" scope="default" type="STRING"/>
         <property name="NO_ENTITY_BODY" action="remove" scope="axis2"/>
         <log level="full"/>
         <send/>
      </sequence>

它在 dss 关闭时传递错误消息,但在 dss 运行模式时不传递,给出这样的错误

its passing fault message whenever dss is off but not passing when dss is running mode giving error like this

Caused by: com.ctc.wstx.exc.WstxParsingException: Illegal processing instruction target ("xml"); xml (case insensitive) is reserved by the specs.
 at [row,col {unknown-source}]: [1,167]

推荐答案

正如错误所说:非法处理指令目标(xml");xml(不区分大小写)由规范保留.",您似乎在从 DSS 返回的响应中使用了保留字xml".请仔细检查来自 DSS 的 XML 响应,并通过 XML 验证器(可能使用 Eclipse XML 验证器)运行响应以查看响应是否一切正常.

As the error says: "Illegal processing instruction target ("xml"); xml (case insensitive) is reserved by the specs." it seems that you are using a reserved word "xml" in the response that you return from DSS. Please double check the XML response from DSS, and run the response trough an XML validator (may be use Eclipse XML validator) to see if the response is all OK.

这篇关于我如何在未将响应传递给客户端的 Wso2ESB 中处理此问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆