cancel
Showing results for 
Search instead for 
Did you mean: 

Start Virtual Service with specific Response in Service V Pro

Highlighted
New Contributor

Start Virtual Service with specific Response in Service V Pro

I have a question regarding the REST Virtual Service with Serice V Pro.

In my case, I configured a REST POST request. There I have defined two different answer, as an example.

Response 1:
<Value> 1 </ value>

Response 2:
<Value> 2 </ value>

Is it possible to start the service with a specific response as desired? In one case it is Response 1 and in another case Response 2.
Best regardless of data from the request etc. No headers, no parameters etc.

It would not be that bad of Soapui, maybe even Groovy.

Thank you!

Best regards, Christoph
3 REPLIES 3
Highlighted
Community Hero

Re: Start Virtual Service with specific Response in Service V Pro

Hi Christoph,

 

Can you provide more details? Should service always reply with Response1? Or should it randomly use Response1 or Response2?

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
New Contributor

Re: Start Virtual Service with specific Response in Service V Pro

Hello, Alex,
Thank you very much for your request.

In the best case permanently, as required Response 1, or Response 2 as well as Standard. But so that I can set the standard from the outside. Best per Groovy.

Many greetings, Christoph

Highlighted
Community Hero

Re: Start Virtual Service with specific Response in Service V Pro

Hi,

 

Can you provide an example?

 

Static request assumes same static response. I can hardly imagine web service that for the same static request returns one response today and another response tomorrow.

If you need to reply with different responses to the request of the same structure but with different parameters, then you should use different dispatch style depending on how parameters are provided in the request.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
Let's start July with new challenges!

Create a script to change request body before sending it to the server for the TechCorner tag!


Scripts created in June:
- A script to generate a request body based on data from Datasource
- A script to go through all response nodes and check the value of the required field
- A Dispatching script to get responses based on the values in Request Body
- A script to add a new tag and assign it to all TestCases in a TestSuite