Service Virtualization

  • 1.  how to send multiple responses to single request?

    Posted Feb 21, 2016 07:07 AM

    Hello,

     

    My requirement is to send multiple responses to single request.There would be several operations/transactions in  VSI/service image and for each transaction i had to send multiple responses (3 responses). I am using JMS transport protocol. I have created vsm and vsi using req-resp pairs. Could you all please tell how this is possible?

     

    Thanks in advance,



  • 2.  Re: how to send multiple responses to single request?
    Best Answer

    Posted Feb 21, 2016 03:34 PM

    You can have multiple response files for each request.  The files follow the pattern <op>-req.xml and <op>-rsp<number>.xml

    This is covered in the DevTest 9.0 manual on page 733

    Import Request/Response Pairs

    A request/response pair consists of one request file and one or more response files.

    When you import a request/response pair, the request is processed against the virtual service.

    If the virtual service contains a signature with the same arguments, a specific transaction is added to

    the signature.

    If the virtual service does not contain a signature with the same arguments, a signature is added. The

    details of the request and response are added as a specific transaction in the signature. A default

    transaction is also added.

    The request/response pair must be in text or XML format.

    The following list contains an example of the file names in a request/response pair:

    • depositMoney-req.xml
    • depositMoney-rsp1.xml
    • depositMoney-rsp2.xml
    • depositMoney-rsp3.xml

    The request file name must include a prefix followed by the string -req.

    The response file name must include the same prefix followed by the string -rsp. As the preceding

    example shows, you can provide multiple response files by adding a number after the string -rsp.

    Multiple response files are applicable to messaging scenarios.



  • 3.  Re: how to send multiple responses to single request?

    Posted Feb 21, 2016 03:43 PM

    I have created the req and resp files in the same pattern , but how my vsi will know give 3 responses within delays ...as there are no. of operations and each operation, transaction has 3 responses ....Do I need to make any changes or include any steps in vsi to return multiple responses after some delays ?? I am using JMS protocol



  • 4.  Re: how to send multiple responses to single request?

    Posted Feb 21, 2016 03:52 PM

    Once the VSI has been created you should be able to adjust the "Think time spec" to to produce the delay you need.



  • 5.  Re: how to send multiple responses to single request?

    Posted Feb 26, 2016 01:00 PM

    Hi Jason,

     

    I have created vsi/vsm using JMS transport protocol and request-response pairs(1 req and 3 resp files). so in my vsi I am having 1 META and 1 specific transaction. and in specific transaction I can see 3 responses not the one as you showed above separately and even if i use same transaction then i cant add different delays ... do i need add different specific transaction i.e for each response ? And when i try to hit the service using above settings it displays error ?

    Please suggest !

     

    Thanks



  • 6.  Re: how to send multiple responses to single request?

    Posted Feb 28, 2016 04:27 PM

    Hi,

    Sorry it may have been a bit confusing.  The images I included are multiple responses from the same specific transaction.  You don't need "duplicate specific transactions" - This would give you 1 response for each request, with the response being one select from the list of duplicate transactions you have defined.

     

    You can view/add/reorder multiple responses for a specific transaction using the buttons on the response tab.  I know it's not very well documented in the manual.

    Clicking on the "play" button moves on to the next response...

    Clicking on the "plus" button adds a new response...

    Note: each response has it's own think time. I believe the think time is the time the VSE waits from the previous response (or the request coming in - for the first response) - but you may need the play around with this to confirm this and get the right values for your solution.

    Let me know how this goes.