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:
Point to the APIs (Virtual) node in the Navigator panel and click :
This will invoke the New Virtual Service dialog (see below).
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:
This will invoke the Generate Virtual Service dialog (see below).
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:
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: