Ask a Question

Wanting to transfer a json response value to an endpoint of the next REST call

SOLVED
ddavie1
New Contributor

Wanting to transfer a json response value to an endpoint of the next REST call

I am using soap ui 5.2.0.  I am creating a test where I need to transfer a json data element from a respone and put it in the endpoint of the next rest client call.

I am using the Property Transfer step. I managed to get the id I wanted from the json respone by choosing Source:[Rest Request Name] Property: Response Path Language: JSONPath.

 

{"id":"aef1810c58a9451b9196a4f45f718b28"}

When I execute the property transfer step I get in the transferred value colum of the transfer log the value  [aef1810c58a9451b9196a4f45f718b28]

 

I can't workout how to add the return value to the endpoint of the next rest client call

The endpoint I want to update is /bim/api/projects/1879048455/models/9cd9bf1f3bba4689b3c7fac030aded9d

where I need to replace the guid in the endpoint with the one that I received from the previous response.

I have

Target: [Name of the Next Rest Client Call]

Property: Endpoint

PathLanguage: JSONPath

 

I am not even sure if I should have the old guid in the endpoint or just have /bim/api/projects/1879048455/models/

But if I do that then the original Rest client call does not work.

 

Could some one please help?

 

 

 

 

2 REPLIES 2
nmrao
Community Hero

check the below link, to see if it helps
http://www.soapui.org/rest-testing/understanding-rest-parameters.html


Regards,
Rao.
ddavie1
New Contributor

Thanks that did the trick Smiley Happy

 

What I did was for my second rest call I added a parameter at resource level as:

Name=id

Value=[the guid]

Style=Template

Level=Resource

 

Then in the target of the property transfer step I put

Property=id

PathLanguage=JSONPath

 

I can now run the test suite so that I can get a guid dynamically and assign it to the endpoint of next rest statement to allow me to locate the correct list itme and update the name

cancel
Showing results for 
Search instead for 
Did you mean: