【问题标题】:Mule Xpath for soap response用于肥皂响应的 Mule Xpath
【发布时间】:2014-05-29 21:27:21
【问题描述】:

我有下面的肥皂响应,我想使用 xpath 从 xml 中获取状态值。

soap:Envelope
soap:Body
ProcessMTUConsignmentSourceResponse xmlns="http://www.compdata.com.au/"
ProcessMTUConsignmentSourceResult
ConnoteSourceImportResponse xmlns=""
ProcessTime 2014-05-29T22:12:50+1000 ProcessTime
Status Success Status
Message Connote Import Success Message
ConnoteSourceImportResponse
ProcessMTUConsignmentSourceResult
ProcessMTUConsignmentSourceResponse
soap:Body
soap:Envelope

xmlns:soap="http://www.w3.org/2003/05/soap-envelope"

在 mule 配置文件中添加了如下命名空间

谁能帮帮我。

【问题讨论】:

    标签: xml xpath mule


    【解决方案1】:

    从 XML 中获取状态的 Mule XPATH 表达式如下

    #[xpath('//comp:ProcessMTUConsignmentSourceResponse/comp:ProcessMTUConsignmentSourceResult/comp:ConnoteSourceImportResponse/comp:Status').text]
    

    在此之前将命名空间添加到 Mule 命名空间管理器

    <mule-xml:namespace-manager>
        <mule-xml:namespace prefix="soap"
            uri="http://www.w3.org/2003/05/soap-envelope" />
        <mule-xml:namespace prefix="comp"
            uri="http://www.compdata.com.au/" />
    </mule-xml:namespace-manager>
    

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2012-09-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-27
      • 1970-01-01
      • 1970-01-01
      • 2013-10-06
      • 1970-01-01
      相关资源
      最近更新 更多