Parsing XML in Groovy



I've read through the documentation, but can't get this working. What I'm trying to do is parse this XML string



<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://ift.tt/sVJIaE">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>TriggeredMessageFault</faultstring>
<detail>
<TriggeredMessageFault xmlns="urn:fault.domain.com">
<exceptionCode>INVALID_PARAMETER</exceptionCode>
<exceptionMessage>Invalid campaign object</exceptionMessage>
</TriggeredMessageFault>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>


What I'm trying to do is get to exceptionCode and exceptionMessage and store those in two different variables.


No comments:

Post a Comment