Creating Requests (Operations)

Applies to ReadyAPI 3.51, last modified on March 04, 2024

The ways you add virtual requests to a virtual API are different for REST, SOAP, JMS and JDBC virtual services.

Create from toolbar

  1. Select your virtual service in the Navigator panel to open the virtual service editor.

  2. In the virtual service editor, click one of the following commands:

    • Action (REST virtual services)
    • Operation (SOAP virtual services)
    • JMS Route (JMS virtual services)
    Service virtualization and API testing: Create REST virtual operation

    Click the image to enlarge it.

    Service virtualization and API testing: Create SOAP virtual operation

    Click the image to enlarge it.

    Service virtualization and API testing: Create JMS virtual operation
  3. This will invoke the dialog, where you can specify properties of the new request. For detailed information, see topics of the Virtual Service Specifics section.

Add from specification (REST & SOAP only)

If you have an OpenAPI, Swagger, WADL or WSDL specification added to your ReadyAPI project, you can automatically create virtual requests for the operations defined in that specification:

  1. In the Navigator panel on the left, select Generate Virtual Service from the flyout menu for your service.

  2. In the subsequent dialog:

    • Select the operations you would like to add to your service.

    • Select Add to existing virtual service and then choose your service in the Virtual Service drop-down list:

      Service virtualization and API testing: Create an operation from service specification

      Click the image to enlarge it.

    Click OK.

Clone existing operation (REST, JMS & JDBC only)

Cloning helps you quickly create a new operation using an existing operation as a base. To clone an operation:

  1. Find the desired “base” operation in the virtual service editor, and click Duplicate VirtAction:

    Service virtualization and API testing: The Duplicate VirtAction command

    Click the image to enlarge it.

    The new operation will be added at the end of the operation list.

  2. Select the operation name in the list, and in the editor on the right, change the resource path:

    Service virtualization and API testing: Change the resource path after cloning an operation

    Click the image to enlarge it.

    If you keep the resource path, this will mean you have two virtual operations for the same resource (for the same page). Your virtual service will use only one operation – the operation it will find earlier in the list.

Recording requests (REST, SOAP & JDBC only)

To add requests based on a real API operation, you need to configure your virtual service to use recording and to record non-virted operations. For complete information, see Add Recorded Operations to Virtual Service.

Further actions

After you create a virtual operation, you need to create and configure virtual responses for it and set dispatch settings for selecting the responses. See Creating Responses and Response Dispatching.

See Also

Configuring Virtual Services
Creating Responses
Add Recorded Operations to Virtual Service

Highlight search results