- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2018 01:48 AM
Hi Friends,
I have done remedy to ServiceNow integration using soap web service, Having problem to parse XML response and setting the incident number to ServiceNow custom field named remedy incident number.
soap xml response
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns0:HelpDesk_Submit_ServiceResponse
xmlns:ns0="urn:COL_HPD_IncidentInterface_Create_WS"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ns0:Incident_Number>INC000000121114</ns0:Incident_Number>
</ns0:HelpDesk_Submit_ServiceResponse>
</soapenv:Body>
</soapenv:Envelope>
Tried XML parsing in the Business rule but no luck
var xmlDoc = new XMLDocument();
xmlDoc.parseXML(responseBody);
var correlationID = xmldoc.getNodeText("//ns0:Incident_Number");
Solved! Go to Solution.
- Labels:
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2018 02:13 AM
Hi,
Can you try the given script in your business rule.
var response = s.execute();
var ResponseBody = response.getBody();
var status = response.getStatusCode();
var xmlDoc = new XMLDocument2();
xmlDoc.parseXML(ResponseBody);
var correlationID = xmlDoc.getNodeText("//ns0:Incident_Number");
gs.log(correlationID);
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2018 02:03 AM
Hi,
Did you try to parse it using XMLDocument2 instead of XMLDocument?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2018 02:07 AM
Hi,
You are not getting data in xml format first you have convert that data into XML format ,because I can see
object as a response.
You can do first that response data in stringformat if it is getting then you can parse it.
JSON.stringify(); there is method you can use that method.
then write your script.
var xmlDoc = new XMLDocument();
xmlDoc.parseXML(responseBody);
var correlationID = xmldoc.getNodeText("//ns0:Incident_Number");
Thank You
Gajanan Biradar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2018 02:13 AM
Hi,
Can you try the given script in your business rule.
var response = s.execute();
var ResponseBody = response.getBody();
var status = response.getStatusCode();
var xmlDoc = new XMLDocument2();
xmlDoc.parseXML(ResponseBody);
var correlationID = xmlDoc.getNodeText("//ns0:Incident_Number");
gs.log(correlationID);
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2018 02:29 AM
Thanks Bhawana it's working for me