Forum Discussion
M_McDonald
14 years agoSuper Contributor
The script log should at least have a time stamp even if there is no content:
[tt:1taejdbt]Thu Jul 12 10:16:06 EDT 2012:INFO:[/tt:1taejdbt]
That is the error log; the error is occurring when you try to create the XML holder with something it doesn't like. An empty argument could be one of those. Somehow you are not getting the response content that you should.
Just to prove the script works, try embedding the (abbreviated) response in the Groovy script and see that you get the token:
[tt:1taejdbt]Thu Jul 12 10:16:06 EDT 2012:INFO:[/tt:1taejdbt]
That is the error log; the error is occurring when you try to create the XML holder with something it doesn't like. An empty argument could be one of those. Somehow you are not getting the response content that you should.
Just to prove the script works, try embedding the (abbreviated) response in the Groovy script and see that you get the token:
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
//def response = context.expand( '${loginClerk#Response}' )
def response = '''<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:loginClerkResponse xmlns:ns2="randomsite.com/">
<return><![CDATA[<random><status>100</status><statusMessage>Login Accepted</statusMessage><response><authToken>l463ddsgs4xkhrw3j1yg19uf</authToken></response></random>]]></return>
</ns2:loginClerkResponse>
</S:Body>
</S:Envelope>'''
log.info response
def holder = groovyUtils.getXmlHolder( response )
def cdata = holder.getDomNode('//return/text()').nodeValue
def holder2 = groovyUtils.getXmlHolder( cdata )
def authToken = holder2.getDomNode('//authToken/text()').nodeValue
log.info authToken
return authToken