2

I am trying to get a sessionID value from an XML response after a http request. However the response is not a clear XML, so I can't write a propertly expression to get this value.

Any idea to do that?

Response of the HTTP Request

Response of HTTP Request

Property Transfer

1

Use Groovy:

def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ) 
def responseHolder = groovyUtils.getXmlHolder( "CHANGE THIS TO YOUR SOAP CALL ID#response" )  

// Extract ProposalId field from the XML
def dataString = responseHolder.getNodeValue["//<CMFResponse><ReturnCode>"]
// Use split to extract the required data
def temp1, temp2, sessionId
temp1 = dataString.split("SessionID=")
temp2 = temp1.split("]]>")
sessionID = temp2[0]

Mark Smith

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.