Recording Virtual Services (Discovering)

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

Virtual service discovery means recording HTTP or HTTPS traffic to some existing API and creating a virtual service from the recorded requests and responses, that is, ReadyAPI will create virtual operations based on the requests and responses it detected during the recording.

You start the recording in the New Virtual Service dialog or in the New Virtual API wizard, or by clicking Discover on the toolbar. All these approaches are similar, but differ in minor details. This topic describes recording virtual services with the New Virtual Service dialog and the toolbar command. For information on using the wizard, see Recording Virtual Services (New Virtual API Wizard).

Supported virtual service types

You can record operations for REST and SOAP virtual APIs. To record JDBC virtual services, start with an empty JDBC service.

Recording JMS operations is not supported.

Built-in browser and recording modes

In ReadyAPI, you record traffic with the built-in browser window. You can send requests directly from within this window, or configure the internal browser to function in proxy mode. In the latter case, you send requests from some other browser or from your client application (for instance, from your mobile app), and the browser will detect and record the requests.

When you send requests from the built-in browser window, ReadyAPI sends regular GET requests through HTTP or HTTPS. To record SOAP traffic, as well as REST operations of non-GET type (like POST or DELETE), use the Proxy mode.

See below for more information on recording in Proxy mode.

Recording steps

1. Start recording

You can start recording in any of the following ways:

The New Virtual Service dialog

The Discover toolbar command

2. Send requests

You send requests to an existing API from the browser that is built into ReadyAPI:

Service virtualization and API testing: The Internal Browser window

Click the image to enlarge it.

Before you start, select the functioning mode of the browser: Internal browser or Proxy.

Internal browser

To record traffic in this mode, simply specify the URL of the desired live API and click Go. To record another response for the same request, send this request one more time.

The browser sends GET requests via HTTP or HTTPS. So, this mode is typically used for recording REST requests of the GET type. To record SOAP traffic, as well as REST requests of other types, use the Proxy mode.

Proxy

In this mode, the internal browser functions as a proxy. You send requests from some other browser or a client application that resides on your computer or on a machine in your local network and the internal browser detects the traffic and records requests and responses. An example of a client application is cURL or a mobile client application (this approach helps you create virtual services for Internet-of-Things APIs).

Note: Use the proxy mode for recording SOAP operations and REST operations of the POST, PUT and other non-GET types.

To record traffic:

  1. Before you send any request, configure the client application (or browser) to use the internal browser as a proxy. You can see the configuration settings for HTTP and HTTPS traffic in the internal browser’s window.
    The internal clients term means the client application running on your computer; external clients means client applications or browsers running on other machines in your network.

  2. Send requests from the client application (or browser) to your live API.

You can view the recorded operation on the Transactions page of the built-in browser’s window (see below).

For more information on working with the internal browser, see Discovery.

3. Filter recorded operations (transactions)

To view recorded requests and responses, switch to the Transactions page:

Service virtualization and API testing: Recorded requests and responses on the Transactions page

Click the image to enlarge it.

Each line on the page corresponds to a transaction (operation). It has the incoming message (request) and outgoing message (response).

To view the context of a request or a response, simply click that request or response on the page. The contents (headers and body) will be shown on the right.

To create a virtual service, you need to select check boxes for those operations that you would like to add to your virtual API. Click Select All or Deselect All, if needed.

Filter Section

Use the Filter section at the top of the transaction list to find an operation quickly. You can filter operations by their method (like GET, PUT or POST), content type, response code or URL. All the drop-down lists contain the values that the recorded operations contain. For instance, if you have not recorded POST requests, the Method drop-down list will not have the POST item.

The URL filter applies only to the Incoming column. It searches for the operations whose URL contains the value you entered in the URL edit box. This search is case-sensitive.

4. Save recorded traffic

During the recording, the new virtual service does not exist yet. To create it:

  1. Select the needed operations on the Transactions page.

  2. From the Virtual Service Type drop-down list (it is at the beginning of the Filter line), select the service type: REST or SOAP.

  3. Click Create New Virtual Service in the bottom right corner of the internal browser window.

ReadyAPI will stop recording and will create virtual operations from the recorded requests and responses.

To add recorded operations to an existing virtual service, simply click Add to Existing Virtual Service and select the service in the subsequent dialog box.

Notes

  • To record several responses, simply send the same request several times during the recording.

  • If you request the same resource with different parameters, the virtual service will record several operations.

  • To cancel the recording without saving any recorded operations, simply close the internal browser window.

  • Although you can record REST and SOAP traffic at the same time, you need individual services for SOAP and REST operations.

See Also

Creating Virtual Services

Highlight search results