Service Virtualization

  • 1.  Data driven service virtualization

    Posted Oct 18, 2016 01:20 AM

    Hi ,

     

    Please help me to create data driven service virtualization for SOAP and Restfull services.

     

    Request you to please share the steps in details so I can implement that accordingly.

     

    With regards,

    Akshay



  • 2.  Re: Data driven service virtualization
    Best Answer

    Posted Oct 18, 2016 10:14 AM

    As a first step, please take a look at the documentation on data-driven virtual services. If you need more information than what is provided, let us know.

     

    https://docops.ca.com/devtest-solutions/9-5/en/using/using-ca-service-virtualization/using-devtest-portal-with-ca-service-virtualization/data-driven-virtual-services



  • 3.  Re: Data driven service virtualization

    Broadcom Employee
    Posted Nov 11, 2016 11:50 AM

    Creating a Data Driven Service

     

    A Data Driven service consists of a WSDL to define a service and a spreadsheet to supply the data.

     

    In this example we will create a Data Driven Virtual Service (DDVS) that simulate the public ZIP code lookup site http://www.webservicex.net/uszip.asmx.

     

    You can find the WSDL used in this service at:

     

    https://github.com/prusnak/excusa/blob/master/wsdl/uszip.wsdl

     

     

    Creating the initial service

     

    In DevTest 9.5.1 the service is initially created using Workstation (File/New/VS Image/From WSDL)  Create a new service using the specified WSDL.  The example service is called ZIP:

     

     

    Point to the USZIP.WSDL file:

     

     

    Select all the operations.

     

     

    Not surprisingly, the protocol is SOAP.  Complete the virtual service.

     

    Loading the Data

     

    The data is loaded in the Portal.  Go to Manage/Virtual Services and click on the pencil icon:

     

     

    When initially loaded, the signatures will have the usual WSDL definitions (alphanumeric, numeric, etc.):

     

     

    Click on the Signature Definition tab:

     

     

    Click on the button marked Data Driven Behavior.  He screen will change and it is now ready to load the spreadsheet:

     

     

    The ZIP3.CSV file is very simple:

     

     

    Note that the first row has the column headers, and the subsequent rows have the data that will be used in the VSE.  In this case, the first column is the ZIP code, and the rest of the columns are the information about that zip code.

     

    Either drag and drop the spreadsheet, or press the button to select.  The screen will change, so that each of the request data arguments will have a star, indicating that the field is ready to be assigned to a field in the spreadsheet:

     

     

    We begin by specifying the column that will be used for lookup under Request Data Arguments.  Click on the star under Mapping.  You will get a drop down box.  Select REQ_ZIP.

     

     

    Note that the column headers are not in any particular order.  This this example that’s not a problem, but for very large spreadsheets this can get tedious.

     

    For the return data, we are going to insert the following block of text:

     

    This block defines how we are going to format the returned data.  The {{CITY}} property will be replaced by the data from the CITY column in the spreadsheet, and so on.  We place this text in the response data area:

     

     

     

    Now the service is ready to deploy.

     

    Note – The data is loaded into the VSE when it is deployed.  If the data in the spreadsheet is changed, that change won’t be reflected in the VSE until the next time the service is deployed.  Note also that “deployed” is not the same as “Stop” followed by a “start).

     

    Now that we have deployed the service, we can test it with Application Test in Workstation.  Here is the test:

     

     

    And here is the response when we run it: