This is probably a very easy one for all SoapUI regulars.
In a SoapUI mock service response script, how do I extract the value inside the request I\'m replying to?<
One more example:
def request = new XmlSlurper().parseText(mockRequest.requestContent)
def a = request.Body.Add.x.toDouble()
def b = request.Body.Add.y.toDouble()
context.result = a + b
In this example we get two parameters from the request and convert them to doubles. This way we can perform calculations on the parameters. The sample SoapUI response for this example is:
${result}
You can see how the calculations result is passed back to the response.