Forum Discussion

SofisticatedBea's avatar
SofisticatedBea
New Contributor
8 years ago

Get a JSON value from request and then change response

Hello there! :) 

Im new in the soapUI and Im strugling to get this request response working. I just need to get the request compare some values and then change the response.

So for example my service will check the zipCode and return true if is less than 5000 or false if is over.

The request is just:

 

{

           "zipCode": "5433",

           "name": "Teste Address"

}

And the response from the mock will be:

{

          "isValid" : true (or false)

}

 

 

There is a image too to see what I got, can some one help me?
Thanks

3 Replies

  • Ok I already checked how to change the variale:

     

    {
    "isValid" : ${isValid}
    }

     

    requestContext.isValid = true;

     

    but how can i acess the Json request?