Previous Topic: Request Data Manager Data ProtocolNext Topic: Request/Response Pair Format


REST Data Protocol

REST is a way of calling web services using the HTTP protocol.

The REST data protocol handler analyzes HTTP requests that follow the REST architectural style. The data protocol identifies the dynamic parts of the URI strings. The result is a set of rules. During the playback phase, VSE uses the rules to virtualize HTTP requests that invoke the same operations.

If VSE does not automatically select the REST data protocol, you can select it manually in the data protocols page of the Virtual Service Image Recorder.

You can include the HTTP requests in live traffic or in request/response pairs.

You must use the HTTP/S transport protocol for request/response pairs.

You can configure some aspects of the analysis process.

Each rule contains one or more parameters, which represent the dynamic parts. By default, the parameters begin with the text URLPARAM.

The following sample rules include the parameters URLPARAM0 and URLPARAM1. The parameters must be inside curly brackets in the rule. After the analyzer generates the rule, you can change the URLPARAM identifier.

GET /Service/rest/user/{URLPARAM0}
GET /Service/rest/customer/{URLPARAM0}
GET /Service/rest/customer/{URLPARAM0}/order/{URLPARAM1}

At playback, the following URI strings match the first rule:

GET /Service/rest/user/100
GET /Service/rest/user/101

At playback, the following URI string matches the third rule:

GET /Service/rest/customer/1234/order/5678

Parameters can also be mixed with other constant text if required. For example:

GET /Service/rest/user/{USERNAME}/format.{type}

In this example, the last token could be “format.json” or “format.xml”.

There can be any number of parameters in a token in any position. For example:

GET /Service/rest/users/format.{type}.sortorder.{order}.filter.{filter}

You can use the REST rules editor that appears after a recording to add or modify rules to look like this depending on your requirements. Rules like this can also be generated from WADL or RAML files.