You can quickly create a virtual service (or virtual API) from an API definition in one of the formats listed below, or from an API added to your project:
- OpenAPI 3.0.0 file
- Swagger 2.0 or 1.x file
- WADL file
- WSDL file
- Any web service existing in your project
You do this with the New Virtual API wizard or with the New Virtual Service dialog, see below.
Note that some specification formats support setting example values for response data. If your spec contains such examples, ReadyAPI will use them for generated virtual responses.
Using the wizard
From the main menu, select File New > Virtual API:
– or –
On the Dashboard, click Virtual API in the New Test tile:
In the New Virtual API wizard, select API Definition:
Note: With the wizard, you cannot create a virtual service for an API in your project. You have to use the New Virtual Service dialog for this.
Specify the file location. If the API definition is on your computer, click Browse to find it or specify the path. If it is on the web site, enter the full URL. Click Next.
Select the project to add the virtual API to. To create a new project, select <New Project>.
After you create a virtual service, ReadyAPI offers you to run it immediately, or edit it before starting or deploying.
If you selected to run the virtual service, ReadyAPI will run the service on your computer, and use the HTTP protocol and port 8088 by default. It will display the Virtual Service Overview window, where you can view and simulate virtual operations:
You can view the response data for simulated requests directly in the Virtual Service Overview window. To do this, simply select a request in the operation list. You can also check response data on the Transaction Log page of your virtual service editor.
Using the dialog
Select APIs (Virtual) in the Navigator panel and click Service on the toolbar:
This will invoke the New Virtual Service dialog (see below).
In the dialog, select Definition, choose the specification type (Swagger, WADL or WSDL) and click OK:
ReadyAPI will display a dialog where you will need to specify your Swagger, WADL or WSDL file. After that, ReadyAPI will create a new virtual service and add operations from the definition file to this service.