The ways you add virtual requests to a virtual API are different for REST, SOAP, JMS and JDBC virtual services.
Create from toolbar
Select your virtual service in the Navigator panel to open the virtual service editor.
In the virtual service editor, click one of the following commands:
- Action (REST virtual services)
- Operation (SOAP virtual services)
- JMS Route (JMS virtual services)
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:
In the Navigator panel on the left, select Generate Virtual Service from the flyout menu for your service.
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:
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:
Find the desired “base” operation in the virtual service editor, and click Duplicate VirtAction:
The new operation will be added at the end of the operation list.
Select the operation name in the list, and in the editor on the right, change the resource path:
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.
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.
Configuring Virtual Services
Add Recorded Operations to Virtual Service