Groovy web console

subscribe to the feed Subscribe
to this
site

responseSOAP

Published 1 month ago by adilbek with tags response SOAP
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def d ="""
<s:Envelope	xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
  <RegisterTrustedNumberResponse
   xmlns="http://tempuri.org/">
   <RegisterTrustedNumberResult
    xmlns:a="http://schemas.datacontract.org/2004/07/Dn.Service"
    xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <a:Message i:nil="true"/>
    <a:Status>1</a:Status>
   </RegisterTrustedNumberResult>
  </RegisterTrustedNumberResponse>
</s:Body>
</s:Envelope>
""";

def xml = new XmlParser().parseText(d.toString());

return xml.'s:Body'.RegisterTrustedNumberResponse.RegisterTrustedNumberResult.'a:Status'.toString()