How to create a VS with multiple responses for one request with RRpairs
search cancel

How to create a VS with multiple responses for one request with RRpairs

book

Article ID: 44750

calendar_today

Updated On:

Products

Service Virtualization

Issue/Introduction

- What is the procedure to create a VS that would send multiple responses to the client for one request?

 

Environment

All supported DevTest releases.

Resolution

To create a VS with multiple responses for one request, you will need to supply multiple rsp files in the Request response pairs. 

The request/response pairs should be named with a unique identifier, then a "-req" on the request side and a "-rsp" on the response side, with an .xml or .txt extension. For example, addUserObject-req.xml and addUserObject-rsp.xml. 

Note: A request can have multiple responses. Using the previous example, the following file names would create one request with three responses. 
addUserObject-req.xml 
addUserObject-rsp1.xml 
addUserObject-rsp2.xml 
addUserObject-rsp3.xml 

VSE generates a transaction for each request/response pair in the directory you specify. For HTTP/S, the files must contain the entire SOAP envelope and the header.

Refer to the documentation for the release of DevTest your are on:  "Creating Service Images"

 

Additional Information

This requirement is possible to achieve using RR Pairs. However, if you have to do this using "By Recording", there is no out of the box way for this. Once the VS is created, you would have to modify the VSM to customize it to have repeated steps of "VS Image Response Selection"