Service Virtualization

  • 1.  How to fallback to the live service when an operation of a service is not recorded?

    Posted Nov 15, 2016 07:24 PM

    I would like to have a scenario, where, if one or more operations of a service is not recorded, the VSE should fall back to the live service to fetch the response. Is it possible?

     

    For example, if a service named "TestService" has 10 operations and only 8 operations recorded.

     

    If the client sends a request to the non-existent operation, the VSE should go to live service and fetch the response.

     

    Regards

    Raj



  • 2.  Re: How to fallback to the live service when an operation of a service is not recorded?
    Best Answer

    Posted Nov 16, 2016 12:33 AM

    Requirement:   Request should be routed to live service in case of Unknown Request.

    Solution:

    This can be one of the approach you can take to fulfill the above requirement.

     

    Virtual Service Image

    Assuming it's a HTTP based model, in the VSI go to the Service Image tab and define HTTP-Response-Code in Meta Data section of “Response for Unknown Conversational/Stateless Request” with a value of 404 (standard http response code that is used to indicate that the server could not find what was requested).

     

    During service image lookup if there is no match found then VSE would return the response which is defined in the “Response for Unknown Conversational/Stateless Request”

     

    Virtual Service Model

    In the VS Routing step which should be present in the model after the protocol listen step you can either add a script or a subprocess to define the condition based on which execution mode should be decided during run time. 

     

    Pseudo code

    if (Response-Code == 404) {
       return ExecutionMode.LIVE
    } else {
       return ExecutionMode.EFFICIENT
    }

     

    Runtime

    The Virtual Service execution mode should be set to Dynamic. When the model is running in this mode it determines the real mode at runtime based on the condition specified for each incoming request.



  • 3.  Re: How to fallback to the live service when an operation of a service is not recorded?

    Posted Nov 16, 2016 03:23 PM

    Hi Ashutosh

     

    Don't you think the script step should be present after the response selection step? Because it is only after the response selection step, the script will have access to the response code.

     

    Also how to access request / response object in the script. I think through response object only can I access it's metadata.

     

    SDK documentation does not have the package information for com.itko.lisa.vse.* classes.

     

    Can you clarify?



  • 4.  Re: How to fallback to the live service when an operation of a service is not recorded?

    Broadcom Employee
    Posted Dec 09, 2016 04:04 PM

    Latest versions of DevTest supports "Stand In" execution mode, which will fall through to live system if no virtualized response is found. If you set the model behavior to "Stand In" that should work for you.



  • 5.  Re: How to fallback to the live service when an operation of a service is not recorded?

    Broadcom Employee
    Posted Nov 16, 2016 03:48 PM

    What version of DevTest do you have? You may be able to put the virtual service in "Stand In" mode if the service was created through recording.