Ask a Question

MockService return two responses

Occasional Contributor

MockService return two responses

I have a mock service that simulates a external application on my application.

Right now i'm able to send only one response depending of input but i want two send two responses sometimes but i don't know how to do this on SOAPUI or if its even possible.


To give a better understanding how it works my application i send a request to the external application to create an account. The external service only returns if it's valid or not and if its valid the external application will send a request to my application to procede with the account creation.



App -----------Request----------------> External

App<-----------Is Valid ----------------- External

App<-----------Create Account ----------------- External


I want to simulate this flow with mock service if possible.


Current flow:

App -----------Request----------------> MockService

App<-----------Is Valid ----------------- MockService

Missing last step



Valued Contributor



If I understood you correctly you want to call a mock once and have the mock reply with one initial response (is valid) and then perhaps rather than make a second response, more perform a call back for (create account)?


If this is what you like to do, I think one good way is to get the mock to trigger/run another TestCase (asynchronously) in order to perform the call back using a SOAP/REST Request TestStep. For this please see the code from a post I answered previously:


Of course if I didn't get your intentions correctly, please let me know and I'll see if I can help.




Author of SoapUI Cookbook
Showing results for 
Search instead for 
Did you mean: