12 years ago
xml response with json
Hi, I'm just starting to use soapui to test my web service my response example <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <GetContextV2Response xmlns="http...
import groovy.json.JsonSlurper
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( "Request#Response" )
holder.namespaces["ns"] = "http://myservice/Service"
def result = holder.getNodeValue("//ns:GetContextV2Result")
def slurper = new JsonSlurper()
def json = slurper.parseText(result)
def context = json.ContextId
log.info "ContextId from response is : ${context}"