Issue with ![CDATA[ in SOAP inbound response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2022 06:44 PM
Hi All,
I am working on scripted soap api and after processing the incoming soap api request, I need to trigger response back to source application with custom response nodes.
Below is the same response format where I am facing issue.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<abc>
<Message>The Call retrieved.</Message>
<xyz><![CDATA[<result>some xml data format
</result>]]>
</xyz>
</abc>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Where <xyz> is another xml that I am pushing in the response. and it is ended up by adding 
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 12:26 AM
Probably not parsing the "<result>some xml data format</result>" so it's treated as a string instead of a xml document.
Need to see the code creating the content of reply xml.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2022 12:33 AM
Sample on how to append node to xml.
var str = '<abc><Message>The Call retrieved.</Message><xyz></xyz></abc>';
var xmlDoc = new XMLDocument2();
xmlDoc.parseXML(str);
var result = '<result>some xml data format</result>';
var xmlNode = xmlDoc.getNode("/abc/xyz");
xmlDoc.setCurrentElement(xmlNode);
xmlDoc.createElementWithTextValue("result", "some xml data format");
gs.info(xmlDoc);
Execution result:
*** Script: <?xml version="1.0" encoding="UTF-8"?><abc><Message>The Call retrieved.</Message><xyz><result>some xml data format</result></xyz></abc>