2. Create Virtual Service

Applies to ReadyAPI 3.56, last modified on November 25, 2024

Let’s now add a virtual API (or a virtual service) to the project. The virtual service will emulate the web service. You can send requests to it, and it will return responses.

To create a virtual service:

  1. Point to the APIs (Virtual) node in the Navigator panel and click :

    Service virtualization and API testing: Add a virtual service

    This will invoke the New Virtual Service dialog (see below).

  2. In the New Virtual Service dialog, select Definition > From existing API in project to create a virtual service from the service specification we have in the project, and, in the subsequent dialog, select the CurrencyConvertorSoap spec:

    Service virtualization and API testing: Selecting specification

    This will invoke the Generate Virtual Service dialog (see below).

  3. In the Generate Virtual Service dialog, select the ConversionRate operation, specify the virtual service name, path (it will be added to the service URL) and the port, on which the virtual service will function. Let’s keep default values in these fields and click OK to create the service:

    Service virtualization and API testing: Generation SOAP virtual service

    For more information on the dialog, see Generating Virtual Services.

ReadyAPI will create the new virtual service and open it for editing. You can see the service properties on the right:

Service virtualization and API testing: Virtual API properties

Click the image to enlarge it.

Prev          Next

See Also

Data-Driven Virtual Services – Tutorial

Highlight search results