Parsing XML and not able to get the node value I want

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2016 02:54 PM
Hello Everyone!
I am trying to parse a value out of an XML response, and I can't seem to get it. The response is returning correctly to me as needed (verifying using tostring() as you see below), but when I try to grab the "RequesterID" value that I need, I always get a return value of "null". Code Snippet below as to how I'm trying to grab it, and I have also attached the response. Pretty sure this is something simple, but I'm missing it...
var xmlDoc = new XMLDocument2();
xmlDoc.parseXML(responseBody);
//gs.info(xmlDoc.toString());
gs.info(xmlDoc.getNodeText("//RequesterID"));
Thanks for any help!
Jason
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2016 10:12 AM
Hi Jason,
Alternatively, may be converting the XML to JSON unless it is a bigger payload could be beneficial as pointed by the post below:-
Processing Inbound XML - Scoped Application Strategy