Hi Nikhil,
If the script correctly adds status to the request argument then the issue
is not with the script. From what you say I believe the script works
correctly because your transactions inside your VSI have the status
argument.
Is the "status" argument marked as a magic string inside the VSI? Because
if not then the property request_status will not exist.
During testing, have you verified in the inspection view that the request
transaction coming into the VS also has the status argument present?
Because if not then your script worked during the creation of the VSI but
is maybe missing in the VSM (or has an other issue there).
Cheers,
Danny Saro
Client Services Consultant
Broadcom Software
-------------------------------------------------
--
This electronic communication and the information and any files transmitted
with it, or attached to it, are confidential and are intended solely for
the use of the individual or entity to whom it is addressed and may contain
information that is confidential, legally privileged, protected by privacy
laws, or otherwise restricted from disclosure to anyone else. If you are
not the intended recipient or the person responsible for delivering the
e-mail to the intended recipient, you are hereby notified that any use,
copying, distributing, dissemination, forwarding, printing, or copying of
this e-mail is strictly prohibited. If you received this e-mail in error,
please return the e-mail to the sender, delete it from your computer, and
destroy any printed copy of it.
Original Message:
Sent: 9/14/2022 5:07:00 PM
From: Nikhil Singh
Subject: unable to add argument and apply in response using scriptable data protocol
request file:
GET /test/portal HTTP/1.1
connection: keep-alive
content-type: application/json
{
"name":"30206151900",
}
----------------------------------------------------------------------------------------------------------------------------------------------------
beanshell script in scriptable data protocol:
%beanshell%
import com.itko.util.ParameterList;
import java.io.*;
import java.util.*;
import java.lang.String;
import com.itko.util.ParameterList;
ParameterList args = lisa_vse_request.getArguments();
newval2 = "30206151900";
newVal3 = "302061520";
addr = "new zealand";
if(args.getParameterValue("name").equals(newval2)) {
addr = "wellington street, australia,";
}
if(args.getParameterValue("name").equals(newVal3)) {
addr = "new york street, us";
}
args.setParameterValue("status", addr);
lisa_vse_request.setArguments(args);
the argument "status" is getting added in vsi file but when i add "name": "{{=request_status;/*302061519*/}}" in reponse body it is unable to detect the data/value based on above script