How to update VSE request and send it to LIVE system


Article ID: 127510


Updated On:


CA Application Test Service Virtualization CA Continuous Application Insight (PathFinder) CA Service Virtualization (DevTest / LISA / VSE / Application Test)


There will be some scenarios where VSE request need to be modified before going to the LIVE system (LIVE Invocation step). This article will provide information on how to achieve it.


For example, below is the sample request hitting the VS. 

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="" xmlns:xsd="" xmlns:xsi="">
        <getTransactions xmlns="">
            <accountId xmlns="">1313094687566198</accountId>
            <from xsi:type="xsd:dateTime" xmlns="">2011-08-04T20:35:37.660Z</from>
            <to xsi:type="xsd:dateTime" xmlns="">2011-08-11T20:35:37.660Z</to>

When the request go to LIVE system the value "1313094687566198" need to be changed to "2567123476542345".


All supported DevTest environments.


The property "lisa.vse.http.current.transaction" holds the current transaction information in VS and lisa.vse.http.current.transaction.body" holds the request payload.

To change the VSE request payload, need to capture it first and modify that with the desired value and then set the new payload in the current transaction.

In the VSM, this can be done in an "Execute Script" step or in a "Scripted Assertion" with the below Beanshell code before the LIVE Invocation step.

import com.itko.lisa.vse.http.HTTPTransaction;
import com.itko.lisa.vse.http.Transaction;

String OriginalRequestBody = testExec.getStateValue("lisa.vse.http.current.transaction.body"); // Original request payload hitting the VS
String MofifiedRequestBody = OriginalRequestBody.replace("1313094687566198","2567123476542345");   // Original Text to be replaced- "1313094687566198"  Replacement Text - "2567123476542345"

HTTPTransaction transaction = ((HTTPTransaction) testExec.getStateObject("lisa.vse.http.current.transaction"));  // Get the current transaction
transaction.setPayload(MofifiedRequestBody);  // Setting the new payload
return testExec.getStateValue("lisa.vse.http.current.transaction");  // Returning the current transaction with the updated payload

Additional Information

The functionality in this article is customization. The code provided in the instructions is very basic and it can be extended per the functionality.