Creating Virtual Services From API Definition File

Applies to ReadyAPI 3.52, last modified on April 25, 2024

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

  1. From the main menu, select File New > Virtual API:

    Service virtualization with ReadyAPI: Creating a new virtual API

    – or –

    On the Dashboard, click Virtual API in the New Test tile:

    Service virtualization and API testing: Creating a new virtual API

    Click the image to enlarge it.

  2. In the New Virtual API wizard, select API Definition:

    Service virtualization and API testing: Creating a new virtual API from definition file

    Click the image to enlarge it.

    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.
  3. 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.

    Service virtualization and API testing: Select a Swagger, WADL or WSDL file for your new virtual service

    Click the image to enlarge it.

  4. Select the project to add the virtual API to. To create a new project, select <New Project>.

    Service virtualization and API testing: Select a project for new virtual service

    Click the image to enlarge it.

  5. 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:

    Service virtualization and API testing: The Virtual Service Overview window

    Click the image to enlarge it.

    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

  1. Select APIs (Virtual) in the Navigator panel and click Service on the toolbar:

    Service virtualization and API testing: New Virtual Service toolbar command

    Click the image to enlarge it.

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

  2. In the dialog, select Definition, choose the specification type (Swagger, WADL or WSDL) and click OK:

    Service virtualization and API testing: New Virtual Service dialog

    Click the image to enlarge it.

  3. 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.

See Also

Creating Virtual Service From API Spec in Project
Creating Virtual Services

Highlight search results