Service Virtualization

 View Only
  • 1.  Single Request several response

    Posted Jun 25, 2019 03:00 PM
    I want a single request to be able to answer several respons, and that when executing, random answers are reflected or, failing that, all the answers are shown.


    I want to do this with Pairs.  



    Can you give me an example?


  • 2.  RE: Single Request several response

    Broadcom Employee
    Posted Jun 26, 2019 09:56 AM
    HI,
          Can you share one such request and multiple-response pairs. 

    regards
    Sankar

    ------------------------------
    Sankar Natarajan
    Service Virtualization Product Engineering Team
    Broadcom
    ------------------------------



  • 3.  RE: Single Request several response
    Best Answer

    Posted Jun 26, 2019 10:40 AM
    Also, can you indicate if this is a message-based virtualization (MQ, JMS,...) or if it is HTTP.

    For message-based virtualization the VSI editor has the capability to store multiple responses for one request, and the "standard" VSM takes these into account and sends them all.

    For HTTP-based virtualization the solution to your requirement would actually not be "a virtual service" (because HTTP is synchronous and thus just one request and the response send back on the same open communication channel) but what you need is an asynchronous backend orchestration. For this you will need to adapt your VSM such that the flow acknowledges the receipt of the request (most often an http 200 OK response) and then a loop whereby you use a WebService or REST step to call various endpoints delivering each a separate request. To be correct, in this case you have one response (a synchronous 200 OK) and various request to be sent subsequently)
    In all implementations of this kind that I have done I have almost always used the VSIs multiple response feature to store the "variouse orchestration requests". Response 0 would be the synchronous 200 OK response acknowledging the incoming request. And it is out of the box used by the Response step. The Responses 1 to n would contain the various asynchrounous request that the custom look would process and send to the various endpoints.


    ------------------------------
    Cheers,
    Danny
    ------------------------------



  • 4.  RE: Single Request several response

    Posted Jun 26, 2019 10:43 AM
    ... that the custom *loop would process ...

    ------------------------------
    Cheers,
    Danny
    ------------------------------



  • 5.  RE: Single Request several response

    Broadcom Employee
    Posted Jun 26, 2019 10:56 AM
    As usual, a great response Danny !!

    -Sankar

    ------------------------------
    Sankar Natarajan
    Service Virtualization Product Engineering Team
    Broadcom
    ------------------------------



  • 6.  RE: Single Request several response

    Posted Jun 26, 2019 11:01 AM
    The following example has one request and three responses:

    depositMoney-req.txt
    depositMoney-rsp1.txt
    depositMoney-rsp2.txt
    depositMoney-rsp3.txt

    How to generate a query from the soap this answer answer 3, answer 2 etc.