Forum Discussion

jaypas's avatar
jaypas
New Contributor
16 years ago

Getting the Response String

Hello,
I have a test case that has the following test steps:
Test Request - sends request to web service
Groovy Script - get the response, save it to a file

In the groovy script, how would I get the response into a string?

Thanks,
jaypas

1 Reply

  • astorm's avatar
    astorm
    New Contributor
    It looks something like this:

    groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
    holder = groovyUtils.getXmlHolder("Request 1#Response")
    File responseFile = new File("filename.out")
    responseFile.write(holder.prettyXml)

    Cheers,