AnsweredAssumed Answered

How to set arguments using scriptable DPH?

Question asked by venukg on May 9, 2018
Latest reply on May 9, 2018 by Rick.Brown

I want to set arguments in VSI using scriptable DPH for xml message which is having CDATA with JSON message.

I have approached below process, but still service is not working.


1.Downloaded json-simple-1.1.jar file and placed into lib>core folder.

2. Reloaded the devtest workstation

3. while creating virtual service I have selected Scriptable DPH.

4. added script as below.

import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import com.itko.util.ParameterList;
import com.itko.util.Parameter;
JSONParser parser = new JSONParser();
String str1 = testExec.getStateValue("Test_Process");

String str = str1.substring(str1.indexOf("CDATA[")+6,str1.lastIndexOf("}")+1);
str = str.trim();
JSONObject jsonObject = (JSONObject) parser.parse(str);
String ProductCode = (String) jsonObject.get("hoganProductCode");

ParameterList args = lisa_vse_request.getArguments();
args.addParameter(new Parameter("Hogan_Productcode", ProductCode));


5. created virtual service.

6. added XML Xpath query filter on Listener step and added property as "Test_Process".

7.  loaded VSI and added argument as "Hogan_Productcode".

8. saved the changes and deployed the service into VSE.


below is request message which I have used for this service.


<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:ms="" xmlns:hg="">
    <ns:process xmlns:ns="">

  "TransactionsRequest": {



can some one review my code and help me to resolve the issue.