Ask a Question

MockService return two responses

esfomeado
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.

 

Flow:

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

 

Thanks

1 REPLY 1
rupert_anderson
Valued Contributor

Hi,

 

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:

 

http://community.smartbear.com/t5/SoapUI-Open-Source/How-to-simulate-an-asynchronous-web-service-wit...

 

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

 

Cheers,

Rupert

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