cancel
Showing results for 
Search instead for 
Did you mean: 

Get a JSON value from request and then change response

New Contributor

Get a JSON value from request and then change response

Hello there! Smiley Happy 

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 3
New Contributor

Re: Get a JSON value from request and then change response

Ok I already checked how to change the variale:

 

{
"isValid" : ${isValid}
}

 

requestContext.isValid = true;

 

but how can i acess the Json request?

Community Hero

Re: Get a JSON value from request and then change response

You mean, how to access the json request in in the mock service?


Regards,
Rao.
Highlighted
Visitor

Re: Get a JSON value from request and then change response

yes

New Here?
Join us and watch the welcome video:
6 / 7 API Testing Mistakes Video
Top Kudoed Authors