Introduction
An imitated web service runs on a server, responds to client queries, and receives requests from users. You must include virtual operations (or actions) in your virtual service in order to achieve this capability. They outline the requests that will be made for this service. You can specify one or more potential replies for each request. Depending on the test conditions, the virtual service will return either this or that response. In this article, the reader will learn about virtual services. How to generate virtual services and to Create Virtual Services From API Definition File using the wizard and the using the dialog.
Generating Virtual Services
A virtual service (virtual API) could be generated from a service specification that is already present in your project. A service having virtual operations for several (or all) of the operations specified in your API specification can be obtained in this simple and quick manner.
REST and SOAP virtual services can be used with this strategy:
-
A WSDL specification can create a SOAP virtual service.
-
From an OpenAPI 3.0, Swagger 2.0 or 1.x, or WADL specification, you can create a REST virtual service.
-
This method cannot be used to construct JMS virtual services.
Take these actions:
- Generate Virtual Service can be chosen from the context menu by right-clicking the service in the Navigator panel:

Choose the service in the Navigator, then choose API > Generate Virtual Service from the main menu:

2. In the subsequent dialog:

- Choose which operations (SOAP) or resources (REST) should be virtualized. In the produced service, ReadyAPI will create virtual requests for these tasks. Choose every resource (operation) you wish to include in the service.
-
Select To produce a virtual service, create a new virtual service. Adding operations to an existing virtual service is a potential substitute. View Making Requests (Operations).
-
Give details about the new service's features.
To create the virtual service, click OK.
Select the new virtual service in the Navigator panel's APIs (Virtual) node to view it:
As you can see, ReadyAPI creates default virtual answers for each request as well as virtual requests for the chosen resources (operations).














