AnsweredAssumed Answered

I am facing a problem while parsing an XML which is having CDATA and JSON message and to create an arguments while creating a VS.

Question asked by venukg on Sep 21, 2017
Latest reply on Apr 4, 2018 by venukg

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope >
  <SOAP-ENV:Header>
     </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <ns:process xmlns:ns="http://service.xyz.com">
<![CDATA[
{
  "listTransactionsRequest": {
   "startDate":"00:00:00-00:00",
   "endDate":"00:00:00-00:00",
   "includeUnpostedActivity": true,
   "accountKey":{
     "companyNumber":00

      "AccountNo": 00
  
   }
  }
}
]]>
    </ns:process>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

Problem is to create Argument of "CompanyNumber" / AccountNO?

 

Step 1: I have used data protocol filter on Listener step and below is the script which I used.

JSONParser parser = new JSONParser();

String str1 = testExec.getStateValue("My_JSONMSG");
String str = str1.substring(str1.indexOf("CDATA[")+6,str1.indexOf("]]}>"));
str = str.trim();

JSONObject jsonObject = (JSONObject) parser.parse(str);
String ProductCode = (String) jsonObject.get("hoganProductCode");
       
lisa_vse_request.setOperation("process");
ParameterList args = lisa_vse_request.getArguments();
args.addParameter(new Parameter("Hogan_Productcode", ProductCode));
lisa_vse_request.setArguments(args);

 

Step2: Added XML Xpath filter on Listener step

//*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='ns:process']

 

XML Xpath filter is not capturing the required argument. can some one help me to get the argument.

Outcomes