Reputation: 205
I have the below soap response and i want to get the status value from the xml using the xpath.
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"
added namespaces to mule config file as below
Can someone help me out.
Upvotes: 1
Views: 682
Reputation: 6647
Mule XPATH expression to get the status from your XML is as below
#[xpath('//comp:ProcessMTUConsignmentSourceResponse/comp:ProcessMTUConsignmentSourceResult/comp:ConnoteSourceImportResponse/comp:Status').text]
Before that add the namespaces to the Mule Namespace Manager
<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>
Hope this helps.
Upvotes: 2