Service Virtualization

Expand all | Collapse all

Best approach to develop the VS

Jump to Best Answer
  • 1.  Best approach to develop the VS

    Posted 08-08-2019 04:55 AM
    Hi Team,

    Please provide the best approach to build the below requirement.

    1. Request A triggers to the Virtual Service, then it should respond with Response B
    2. Based on the think time, Request C ( Async Message) will trigger to the client  and Response D will be received to the VS.
    3. Now, when Response D reaches to the VS, I should trigger Request E to the client.

    I'm able to manage the first 2 steps, but i'm failing to do on the last step.

    How to setup a condition to trigger the Request E only when Response D reaches to the VS ?

    Note:- I can't use think time for the last step, due to Response D response time is dynamic.

  • 2.  RE: Best approach to develop the VS
    Best Answer

    Posted 08-12-2019 02:14 PM
    Hello Suryateja,

    I am not sure I understood your requirement and its flow, but regarding your step #3​​, I am wondering if you could set a property to a specific value when you get Response D and then use an assertion to verify this property values. If it matches a specific value then you can move to a different step to trigger Request E.

    More information regarding Assertions:
    Ensure Property Matches Expression Assertion:


    Hope it helps.

  • 3.  RE: Best approach to develop the VS

    Posted 08-19-2019 06:50 AM
    Hello Suryateja,

    As Heloisa mentions, it is difficult to understand the technical details (synchronous responses or asynchronous response) of your requirements. If confronted with such a flow I would always work with the customer to create a sequence diagram to really understand, so if you have one then please post it to the discussion.

    What I do understand is that your requirement calls for a back-end business orchestration (and not just one OOTB virtual service workflow). So, I understand you started to adapt your VSM to create that orchestration workflow.
    Request C will trigger to the client (I assume you added a WebService execution or REST step in your VSM).

    Is Response D the synchronous response that is returned on the request C call OR is Response D a new call from the client to the virtual service? In the latter case case Response D would actually be Request D from the virtual service point of view, and you ould just need a signature for D in your VSI to be able to return Response E?



  • 4.  RE: Best approach to develop the VS

    Posted 09-11-2019 08:44 AM
    Edited by Dinesh Kumar 09-11-2019 08:46 AM

    An alternative, follow below steps:
    Note: If Response from Request E is not relevant to VS.

    1- Create a VS (let's call it VS2) having Sub-process after "VS Image Response Selection".
    2- Apply Next step of "Virtual HTTPS Responder" as "End the Test", this way no response will be sent to original VS.
    2- Sub-process contains Webservice Execution steps to tirgger Request C and Request E one after other as per business logic
    3- Add a WebServiceExecution step in VS(let's call it VS1) having Request A after the "VS Image Response Selection" step.
    4- WebServiceExecution step will invoke VS2.

    by above steps , VS1 invokes VS2 while responding with Response B, while on sides VS2 executes after defined think time and complete execution of Request C and Request E.

    I hope it helps.