Parsing Soap xml
Parsing soap xml
JavaScript
var xml = '<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s\\:Header>
<a:Action s:mustUnderstand="1">http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/ExecuteResponse</a:Action>
<a:RelatesTo>urn:uuid:5e88c623-201a-4d79-aa4c-9ba0ece06b19</a:RelatesTo>
<ActivityId CorrelationId="e5ac0f6c-494d-4c70-b248-0cfc23d9e310" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">893ff7f5-23fc-45f3-85b5-7e3abaaeba4d</ActivityId>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<u:Timestamp u:Id="_0">
<u:Created>2017-12-14T11:27:58.359Z</u:Created>
<u:Expires>2017-12-14T11:32:58.359Z</u:Expires>
</u:Timestamp>
</o:Security>
</s:Header>
<s:Body>
<ExecuteResponse xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services">
<ExecuteResult xmlns:b="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<b:ResponseName>evekbm_PEM_Create_Anfrage</b:ResponseName>
<b:Results xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
<b:KeyValuePairOfstringanyType>
<c:key>Success</c:key>
<c:value i:type="d:boolean" xmlns:d="http://www.w3.org/2001/XMLSchema">true</c:value>
</b:KeyValuePairOfstringanyType>
</b:Results>
</ExecuteResult>
</ExecuteResponse>
</s:Body>
</s:Envelope>';
var xmlText = $(xml).find("soap\\:Body").find("getPurseBalanceResponse").find("getPurseBalanceResult").find("balance").text();
alert(xmlText);