【问题标题】:Error "First Element must contain the local name, Envelop" when consuming JMS messages使用 JMS 消息时出现错误“First Element must contain the local name, Envelop”
【发布时间】:2023-02-01 22:54:57
【问题描述】:

当我的侦听器运行时,它会在我运行时立即出现此错误。无法弄清楚它是做什么的

2023-02-01 16:33:59,899] ERROR {JMSMessageReceiver} - Unknown error processing message org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found prov

我正在收听的有效负载如下所示:

<prov><rowID>122</rowID><msisdn>110000171</msisdn>

以下是代理服务中的配置设置我正在听消息:

<parameter name="transport.jms.Destination">PROV.MAP.RT</parameter>
<parameter name="transport.jms.ContentType">text/xml</parameter>
<parameter name="transport.jms.ConnectionFactory">ProvMapperRealtimeListener</parameter>

【问题讨论】:

    标签: wso2 jms wso2-enterprise-integrator wso2-micro-integrator


    【解决方案1】:

    如果您使用 JMS 入站端点来侦听队列,请在入站 EP 配置中设置以下属性。

    <parameter name="transport.jms.ContentType">application/xml</parameter>
    

    更新

    在您的代理配置中更改以下属性。

    <parameter name="transport.jms.ContentType">application/xml</parameter>
    

    解释

    当消息进入 WSO2 时,它将根据消息的内容类型转换为可处理的格式。对于此 WSO2 使用消息构建器,根据内容类型选择适当的构建器。默认情况下,text/plain Content-Type 是使用 SOAP 消息生成器构建的,因此它需要正确的 SOAP 消息体。由于您有一个 XML,它会因上述错误而失败。一旦将 Content-Type 更改为 application/xml,它将被构建为 XML。

    【讨论】:

    • 我正在使用代理服务,上面的属性集已经更新,请检查
    • 请检查@ycr
    • @WajihHaider 检查更新的答案。
    • 你能帮我解释一下为什么是 application/xml 而不是 text/xml
    • @WajihHaider 我添加了一些细节来看看。
    猜你喜欢
    • 1970-01-01
    • 2021-04-11
    • 1970-01-01
    • 1970-01-01
    • 2017-12-10
    • 1970-01-01
    • 2012-03-29
    • 2019-12-14
    • 2019-11-30
    相关资源
    最近更新 更多