REST RR Pair Format

The CA TDM Portal supports parsing and shredding of RR pair files that contain information in the form of HTTP headers and body. To support the content structure and format that these RR Pair files include, the CA TDM Portal accepts RR Pair files that have .txt extension. The CA TDM Portal accesses the .txt file, evaluates the included HTTP headers and body, and shreds the structure. The portal also establishes a relationship between HTTP headers and the corresponding body. You can perform other operations, for example, import and export on these RR pairs. You can also integrate these RR pairs with your virtual services in CA Service Virtualization.
tdm49
The CA TDM Portal supports parsing and shredding of RR pair files that contain information in the form of HTTP headers and body. To support the content structure and format that these RR Pair files include, the CA TDM Portal accepts RR Pair files that have .txt extension. The CA TDM Portal accesses the .txt file, evaluates the included HTTP headers and body, and shreds the structure. The portal also establishes a relationship between HTTP headers and the corresponding body. You can perform other operations, for example, import and export on these RR pairs. You can also integrate these RR pairs with your virtual services in CA Service Virtualization.
A request .txt file constitutes the following sections; these sections are optional based on the type of the request (GET, POST, PUT, and DELETE):
  • REST method and URI path details
  • HTTP headers
  • Payload request body (XML or JSON)
The general format of a REST call used in a request .txt file is as follows:
<METHOD><a space character><REST API path><space><HTTP-VERSION>
HEADERKEY1:HEADERVALUE
HEADERKEY2:HEADERVALUE
HEADERKEY3:HEADERVALUE
<BLANKLINE>
<PAYLOAD_BODY – COULD BE JSON OR XML>
An example of a request .txt file (for example, POST-JSON-req.txt) following the above format is as follows:
POST /api/sec/contacts/get-available-appointment-time-v1?key1=value1&key2=value2 HTTP/1.1
accept: application/json
content-Type: application/json
Connection: Keep-Alive
User-Agent: LISA
Custom-Header: MyHeaderVal
 
{ "lisa-meta":{ "HTTP-Method":"POST /api/sec/contacts/get-available-appointment-time-v1", "OLB_ACCESS_ID":"41472851", "content-type":"application/json", "Cookie":"SMSESSION=41472851" }, "meta":{ "lang":"en", "appVersion":"1.0.0.0", "osName":"ios", "osVersion":"6.0.0", "deviceModel":"iPad3", "deviceType":"iPad", "deviceAppToken": "xxxxxxxxxxx-TBD-xxxxxxxxxxxxx", "ipAddress": "0.0.0.0" }, "challengeRequest":{ "deviceFingerprint":"xxxxx-xxxxx-xxxxx-fingerprint-to-be-generated-by-RSA-SDK-xxxxx-xxxxx-xxxxx-", "sessionCorrelationId":"XXXXXXXXXXXXXXXXXXXXXXX" }, "request":{ "topicId":1 } }
Similarly, a response .txt file constitutes the following sections:
  • HTTP header
  • Body
The general format of a response .txt file is as follows:
<HTTP-VERSION><space><RESPONSE-STATUS-CODE>
HEADERKEY1:HEADERVALUE
HEADERKEY2:HEADERVALUE
HEADERKEY3:HEADERVALUE
<BLANKLINE>
<RESPONSE-BODY>
An example of a response .txt file (for example, POST-JSON-rsp.txt) is as follows; this response does not include headerkey:headervalue information:
HTTP/1.1 200
{ "result":{ "type":"OK", "sysmsg":"OK @ Fri Feb 15 10:43:01 PST 2013" }, "response":{ "appointmentTimes":[ 1351234800000, 1351234801000, 1351234802000, 1351234803000, 1351234804000, 1351234805000, 1351234806000, 1351234807000, 1351234808000, 1351234809000 ] } }
Note:
For more information about how to use RR pairs to prepare test data for non-relational data sources, see Prepare Test Data for Non-Relational Data Sources. While performing different operations for the RR Pair object type, you can use text RR pair files that contain data in the REST format. You can perform all the functions on these text RR pair files that you can perform on XML or JSON RR pair files.