Creating Virtual Services From API Definition File

Applies to ReadyAPI 3.57, last modified on December 20, 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. Select how to input your API definition. You have two options:

    • File

      • Enter the file path or URL of the API definition in the field provided.
      • Alternatively, click the Browse button to locate and select the file from your computer.
      Service virtualization and API testing: Select a Swagger, WADL or WSDL file for your new virtual service

      Click the image to enlarge it.

    • SwaggerHub Integration

      • Import an API definition from SwaggerHub. This option is available if you've integrated ReadyAPI with your SwaggerHub account. For more details on integration, see the SwaggerHub integration page.
      • Select one of the following options:

        • My API: Search for and select an API from your private SwaggerHub account.
        • Public API: Search for and select an API from publicly available APIs on SwaggerHub.
        Importing API definition from SwaggerHub

        Click the image to enlarge it.

    Tip:

    Use the Filters button to refine the API list:

    • Select specific API specifications: OAS2, OAS3, OAS3.1, AsyncAPI, or All.
    • Optionally, select Private or Public for My API.
    • Click Select All or Deselect All to manage your filter selections.

    Click Next.

  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