I have string like:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<NS1:createResponse xmlns:NS1="http://abc.ru/esf/dto/srvMessages">
<NS1:Header>
<integrationID>wd457665grtyy5444</integrationID>
<nativeID/>
<resultInfo>
<status>ERROR</status>
<errorInfo>
<descr>Error:ESB-002: Failed to createSub. Code=Error whilst processing message:Fault from GW: faultcode=tns:Client faultstring=Could not map property BonusMalusRateForKSK detail=,,</descr>
</errorInfo>
</resultInfo>
</NS1:Header>
</NS1:createResponse>
</soapenv:Body>
</soapenv:Envelope>
And I have code like:
MessageExchange[] me = myTestStepResult.getMessageExchanges()
log.info "[ERROR] " + me[0].getResponseContent()
def matches = me[0].getResponseContent() =~ '<errorInfo>(.+?)</errorInfo>'
log.info "[Result" + matches
What I'm trying to do with groovy is to get message between <errorInfo</errorInfo>
tag
But as result I have like: java.util.regex.Matcher[pattern=<errorInfo>(.+?)</errorInfo> region=0,790 lastmatch=]
Can you help me to get response text with groovy