Adding custom headers to Request/Response when creating VS using RR pairs.
search cancel

Adding custom headers to Request/Response when creating VS using RR pairs.

book

Article ID: 42219

calendar_today

Updated On:

Products

Service Virtualization

Issue/Introduction

How to add custom headers to Request/Response when creating VS using RR pairs

 

 

Environment

All supported DevTest releases and platforms.

Resolution

When VSE creates a service image from request/response pairs, the system can use another file with the request/response pairs named a sidecar file. A sidecar file is a properties file in which you can add key/value pairs that need to be added to the meta data of certain requests, responses, or both. You can add some files that are generic for all requests and responses.

For example:

A directory that is named soap has request/response pair files that are named abc1-req.xml/abc1-rsp.xml, abc2-req.xml/abc2-rsp.xml, and abc3-req.xml/abc3-rsp.xml. 

. If you intend to add specific properties to all request/response files then use the file names meta-req.properties and meta-rsp.properties. in the files,the properties can be added as below:

Content-type=text/plain

isMeta=true

. If you intend to add properties to specific request/response files then add the sidecar files with the naming convention of abc1-req-meta.properties, abc1-rsp-meta.properties and add specific properties as below:

Content-type=application/json

isMeta=false

The entries in the transaction-specific sidecar files (abc1-req-meta.properties and abc1-rsp-meta.properties) override anything that is found in the global sidecar files (meta-req.properties and meta-rsp.properties). Therefore, you can have the set of all the defaults in the global files and then override the defaults for specific transactions with transaction-specific sidecars.