Forum Discussion

noname76's avatar
noname76
New Contributor
15 years ago

Transfer value from request to response

I have in the Request: <web:CorID>XXX</web:CorID>
and I need to use the same value from this param in the MockResponse.
How can I do it, pls?
I have read the help but I do not know how to do it.
Many thanks!
  • noname76's avatar
    noname76
    New Contributor
    Done:

    Request: <buystring>sfddddffss</buystring>

    Script in the Response:

    def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
    def holder = groovyUtils.getXmlHolder( mockRequest.requestContent )

    requestContext.test = holder.getNodeValue( "//buystring" )

    then use "test" in the response ... <expectedDelivery>${test}</expectedDelivery>