Showing results for 
Search instead for 
Did you mean: 

Get data from previous step in virtual service (mock)

Occasional Contributor

Get data from previous step in virtual service (mock)

I have a GET REST service "${Properties 1#agreementId}/${StateDate#result}/tree". As you can see the service uses some properties from the previous test steps.
My question is how can I (if possible) achive this when I use virtual service. I am still running the whole test case and I would like to, depending on the value of the propertie from previous step, return different JSON messages.
But If I only can start a listener on http://localhost:8080 and not add any parameters after that then I can not differentiate the request.

I.e. I would like to write "http://localhost:8080/v1/state/${Properties 1#agreementId}/${StateDate#result}/tree". But I cannot get this to work.

Community Hero

Re: Get data from previous step in virtual service (mock)



If I got your question right, you are using SoapUI for testing and would like that some request(s) are processed by ServiceV but not by the real server.

If the above understanding is correct, then I can think of two options:

a) Change the endpoint address for the required request so that SoapUI send it to the ServiceV instead of the real server;

b) If for some reason the above is not possible, you may consider using the conditional routing functionality of ServiceV -


Does this help?


[Community Expert Group]
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
Occasional Contributor

Re: Get data from previous step in virtual service (mock)

Thanks Alex,
Solution a) wokred.
A bit strange since I did test this but It must have been something else that was wrong at that time as well so it did not work. But sure it works. Thank you

2018 NEWS
Top Kudoed Authors