You can configure your virtual API (virtual service) to record requests that have not been virtualized yet. If you enable recording along with enabling request routing, you can quickly and easily add requests and responses of a real API to your virtual service.
Open the virtual service editor.
Switch Route and Record Non-Virted Requests from the Route Options drop-down list:
This setting commands the virtual service to route those incoming requests for which it has no virtual operations yet and to create a virtual operation from the routed request and a response to it from the real API.
|Note:||You can also record “real” responses for virtual operations in addition to the responses they already have. To do this, simply select the Record Responses check box for the desired operations (it is visible if Routing Mode is set to All or Conditional):
Click to start the virtual service.
Send requests to the virtual service using your client application, browser, SoapUI or any other tool. ReadyAPI will record traffic and create a virtual operation for the routed requests and responses.
To avoid recording duplicates, the virtual service checks the header and body of incoming requests, as well as the data of the responses it receives from the real API:
If the virtual service detects a new request, it creates a new operation.
If the service detects a new response to some recorded request, it records only that response, and does not create a new operation.
If the service finds a request-response pair in the operation list, it does not record any new data.
If the real API returns or can return different responses for the same request, then to record these responses you can simply send the request several times.
The virtual service checks the query parameters of incoming requests (they are specified in the URL after the question mark), and records a new response for each “new” parameter value. The response name indicates the parameter name and value:
If a request has several parameters in the URL, the service records a separate response for each set of parameter values.
The service does not store query parameters in the Resource Path property of the recorded request. This property includes the page (resource) path only: