Service Virtualization

  • 1.  same request with different response

    Posted Jun 10, 2016 02:01 PM


    Hi ,

    I have request call here, where soap request is always same but I need to respond with different responses..

     

    for now I have to choose from two response..

     

    i.e., one is success response and some time my testers expecting delayed response.. but I have seen there is parameter from client to drive this scenario .. any hits how to tackle these cases,.. thanks



  • 2.  Re: same request with different response
    Best Answer

    Broadcom Employee
    Posted Jun 10, 2016 02:25 PM

    What is the criteria for the different response? This parameter from the client - does it get sent anywhere in the request, perhaps as an attribute or a piece of metadata if the actual request arguments are the same?

     

    1. If it's elsewhere in the request message, you can expose it by using the Request Data Manager DPH.

    2. If it's not in the message, but it is a part of a chain of messages in a stateful conversation, your virtual service should be stateful to permit different responses to the same request.

    3. If it's not in the message but can be accessed in another way, you will want to add some logic to the virtual service (database call? REST request?) to expose the parameter and change the Response Selection step to load a different set of responses.

    4. If it's not in the message and there's no way to expose it, you have two further choices:

    a. Add multiple responses to the request. DevTest will automatically round-robin the responses, so you will deterministically get the different response every n calls (where n is the number of responses you've got for the request).

    b. Provide the tester with a mechanism where they can choose the different response (a HTTP virtual service serving HTML, for example) and implement option 3 above.