REST Virtual Service Properties

Applies to ReadyAPI 3.10, last modified on October 07, 2021

REST and SOAP virtual APIs (virtual services) have a similar set of properties. To view or change them, select your virtual service in the Navigator panel. You will see the properties on the right of the ReadyAPI window, and on the left, at the bottom of the Navigator panel:

Service virtualization and API tesitng: Properties of a RESTful virtual service

Click the image to enlarge it.

Properties on the Right

The properties are organized into several groups.

Info

Property Description
Location The computer, where the virtual service resides.
Time running How long the virtual service is running. 0 if the service is not running.
Status Indicates if the virtual service is running or not.
Received The number of incoming requests (including those requests for which the service has no virtual operations).
Sent The number of responses the virtual service sent to clients.
Protocol The virtual service protocol: http or https.
Port The port number, which the virtual service will use for the run. Also, view and change it in the property list in the Navigator panel.
To use the same port number for two virtual services on one computer, set different paths for them.
If you start your service from the command line, use the -m argument to specify a path or another port.
Autostart on server Commands the virtual service to start automatically right after you deploy it to a remote computer.
Path

The path that follows the virtual service computer name and port in the URL string:

http://computer:port/path/{operation-pages}

Also, view and change it in the property list in the Navigator panel.
Virtual service URL The basic URL that you can use for sending a request to the virtual service. This basic URL includes the protocol, the virtual service computer and port and the Path property value. The URL that you use for the call will also include the operation path.
Max Routed Response per Action If you configured your virtual service to use routing, the service will forward incoming requests to some other API, transfer responses from this API to the client that sent the requests, and will then record these responses. This property restricts the maximum number of responses the service will record. You can add the necessary number of additional responses manually.
If the number of incoming requests for an operation exceeds the specified value, the service will route incoming requests and return responses, but it will not record these responses. ReadyAPI will post an informative message to the log in this case.

Assertions

A list of assertions that the virtual service applies to incoming requests to verify their contents. For more information on this, see Assertions in Virtual Services.

To add assertions, click and select the desired assertion in the subsequent dialog. To remove an assertion, select it on the list and click . To modify assertion parameters, select the assertion on the list and click .

The service applies assertions in their order on the list. If needed, select an assertion and change its position with the and buttons.

Assertion Results

This section displays assertion results. It includes both service- and operation-level assertions. Green dots denote passed assertions, red dots indicate failed assertions.

Tip:

To view detailed results for an assertion, simply click the assertion on the list. This will display a list of checks grouped by the result and the cause of a fail.

To get to the request and response contents, double-click the timestamp of a failed or successful execution. This will invoke a dialog box, where you can explore the request and response bodies, headers and properties.

Description

Arbitrary text describing your virtual API. This is the same text that you can view and change on the property list in the Navigator panel.

Properties

A list of user-defined service properties. These are the same properties that you can see on the Custom REST Virtual Service Properties page in the Navigator panel.

The toolbar above the property list contains commands for creating and deleting properties, changing their order, sorting, clearing property values, and loading property values from and saving them to a file.

Start Script

Groovy script code that executes right after the virtual service starts. For information on writing scripts and available script objects, see Virtual Service Scripting.

Stop Script

Groovy script code that executes right before the moment when the virtual service stops. See Virtual Service Scripting for information on writing scripts and available script objects.

OnRequest Script

Groovy script code that is run right after the service receives an incoming request.

Note: The script runs for all requests, including those for which your virtual service has no virtual operations.

See Virtual Service Scripting for information on writing scripts and available script objects.

AfterRequest Script

Groovy script code that is executed after your virtual service replies to the client request.

Note: The script runs for all requests, including those for which your service has no virtual operations.

See Virtual Service Scripting for information on writing scripts and available script objects.

DataSources

Provides information on data sources that your virtual service uses. The Loops column indicates the number of times the service iterated through all the records of the data source during the run.

Properties in the Navigator

REST Virtual Service Properties

Property Description
Name The virtual service name.
Description Arbitrary text describing the virtual service. Also, view and change it in the property editor on the right of the product window.
Path The path that follows the virtual service computer name and port in the URL string:
http://computer:port/path/{operation-pages…}
Also, view and change this value in the editor on the right of the product window.
Port The port number, which the virtual service will use for the run. This is the same value that you can view and change in the editor on the right of the product window.
To use the same port number for two virtual services on one computer, set different paths for them.
If you start your service from the command line, use the -m argument to specify a path or another port.
Response Property Expansion Enables or disables expanding property values in responses. Property expansion is a ReadyAPI feature that enables you to use custom service properties and data source values in virtual responses. See Property Expansion in Responses.

Custom REST Virtual Service Properties

On this page, you can create, delete, edit and view user-defined properties for your virtual API. You can also see and change these properties in the property editor on the right of the product window (in the Properties section).

The toolbar above the property list contains commands for creating and deleting properties, changing their order, sorting, clearing property values, and loading property values from and saving them to a file.

See Also

JMS Virtual Service Properties
Reference

Highlight search results