Adding headers to VS response for all the transactions in VSI?

Document ID : KB000095238
Last Modified Date : 09/05/2018
Show Technical Document Details
When headers need to be added for few transactions, then add them to the transactions response in VSI-->Response MetaData by using Workstation or Portal or manually open it in some editor. If this option is not feasible if VSI has a large number of transactions. This article will provide information on how to add headers to VS response for all the transactions in VSI automatically.
All DevTest supported environments.
Using the Scriptable DPH to the HTTP Responder with the below code will add the specific headers automatically to the response. 
import com.itko.util.ParameterList; 
import com.itko.util.Parameter; 

ParameterList metadata = lisa_vse_response.getMetaData(); 
metadata.addParameter(new Parameter("UserId", "0012xx")); 

In the above code, UserId=0012xx will be sent in the response headers.
Additional Information: