用于soap响应的Mule Xpath



我有下面的soap响应,我想使用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获取状态的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>

最新更新