Hi,
I am trying to parse several details from a SOAP message.
I have looked at many post and i think i need to use xpath.
However, each time i get an error, so i must be formatting my xpath statements incorrect:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ipgapi:IPGApiActionResponse xmlns:ipgapi="http://ipg-online.com/ipgapi/schemas/ipgapi" xmlns:a1="http://ipg-online.com/ipgapi/schemas/a1" xmlns:v1="http://ipg-online.com/ipgapi/schemas/v1">
<ipgapi:successfully>true</ipgapi:successfully>
<ipgapi:OrderId>A-60e00f5b-SomeID</ipgapi:OrderId>
<ipgapi:TransactionId>84521877SomeTransact</ipgapi:TransactionId>
<ipgapi:Url>https://test.p-online.com/connect/processing?store=SomeStore</ipgapi:Url>
</ipgapi:IPGApiActionResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
xpath(xml(body('Http')), 'string(/SOAP-ENV:Envelope/SOAP-ENV:Body/ipgapi:IPGApiActionResponse/ipgapi:TransactionId)')
xpath(xml(body('Http')), 'string(/*[name()=\"SOAP-ENV:Envelope\"]/*[name()=\"SOAP-ENV:Body\"]\"]/*[name()=\"ipgapi:IPGApiActionResponse\"]\"]/*[name()=\"ipgapi:TransactionId\"])')
Solved! Go to Solution.
Thank you so much! it works, this in the final result
xpath(xml(body('Http')), '//*[local-name()="Envelope"]/*[local-name()="Body"]/*[local-name()="IPGApiActionResponse"]/*[local-name()="TransactionId"]/text()')
@yashag2255 - I am trying to accomplish something similar, and I've used your suggestion, but I must be missing something, I can't seem to make it work, the output of the compose step is blank. Here is a sample of the XML that gets returned from in the API response that is going into the Compose step....I need to be able to use the data under <RESOURCES><AIRCRAFT>.
I've tried this so far...but the compose output is just BLANK.
xpath(xml(body('Operations_-_Aircraft_Info')), '//*[local-name()="Envelope"]/*[local-name()="Body"]/*[local-name()="etaWebServicesResponse"]/*[local-name()="RESOURCES"]/text()')
Sample API XML response data.
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:etaWebServicesResponse xmlns:ns1="http://ws.talonsystems.com/Talonws.wsdl" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:string">
<RESOURCES>
<AIRCRAFT>
<AIRCRAFT_ID>XX</AIRCRAFT_ID>
<AIRCRAFT>XXXXXX</AIRCRAFT>
<SITE_ID/>
<SITE/>
<DESCRIPTION>XXXXXX</DESCRIPTION>
<RESOURCE_TYPE>XXXXX</RESOURCE_TYPE>
<COLOR>XXXXXX</COLOR>
<AIRCRAFT_CLASS>XXXXX</AIRCRAFT_CLASS>
.....
.....
</AIRCRAFT>
</RESOURCES>
</return>
</ns1:etaWebServicesResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Hi folks,
I have been struggling with a similar situation.
I have following SOAP response body to parse using xpath in my flow. This response is received by in flow after calling the custom connector to read data from a legacy NAV. I need the value in the XML tag.
<Soap:Envelope xmlns:Soap="http://schemas.xmlsoap.org/soap/envelope/"><Soap:Body><GetRecIdFromKey_Result xmlns="urn:microsoft-dynamics-schemas/page/crm_contact_stg_ws"><GetRecIdFromKey_Result>CRM Contact Stg: 4801</GetRecIdFromKey_Result></GetRecIdFromKey_Result></Soap:Body></Soap:Envelope>
I have tried a number of xpath expressions to get the value from this tag, but I have hit the wall. I really wonder if somebody shares similar experience as I just do. I used online xpath tool as here https://www.freeformatter.com/xpath-tester.html, but many expressions that work here, do not give any results when used as xpath expression in flow. Have you observed the same ? as a standard, any xpath expression (irrespective of which tool it is used in), should give same result ? Or correct me if i am wrongly assuming this.
Anyway, can somebody get me the value of the innermost tag <GetRecIdFromKey_Result> ?
Thanks
Automation continued ...
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
42 | |
18 | |
16 | |
15 | |
13 |
User | Count |
---|---|
69 | |
36 | |
28 | |
21 | |
19 |