I have a response that contains the following:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
<project:loginResponse xmlns:project="http://project.somewhere.com/">
<return>34715527grsbN3C</return>
</project:loginResponse>
</env:Body>
</env:Envelope>
I need to get the value in for a session ID but I get error probably because return is a reserved word. I have tried to escape it but that just treats the line as comments.
groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
holder = groovyUtils.getXmlHolder("login - Request 1#Response" )
return = holder.getNodeValue( "//return" )
assert return != null
assert return.length() > 0
returnNode = groovyUtils.getXmlHolder(loginResponse)
sessID = returnNode.getNodeValue("//return")
log.info(sessID)
assert sessID !=null
context["sessID"] = sessID