Is there a way to remove an XML element in a SOAP getRecord response?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2017 06:40 AM
Is there a way to remove an XML element in a SOAP getRecord response? It's a field that's not needed and causing an issue in the response. Can you write a BR on query that removes that element in a response? Or maybe a setting at the table level on the field?
Thanks,
Chris
- Labels:
-
Integrations
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2017 06:42 AM
Can you provide an example? I'm not clear where the issue is and what the expected outcome is.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2017 06:47 AM
Good morning, Chuck! An example:
SOAP response sends back:
<impact>4</impact>
<incident_state>-8</incident_state>
<knowledge>0</knowledge>
How could I prevent the SOAP response from sending back, say, the knowledge element entirely so it returns:
<impact>4</impact>
<incident_state>-8</incident_state>
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2017 06:51 AM
You could create a scripted (SOAP) web service to send back a custom response.
I'm curious... if the other system (I'll assume a third party app) is receiving this response, what's the big deal of receiving extra content? Your app should be configurable (either by script or pragmatically) to pick and choose what elements it uses (e.g. by Xpath or whatever). Other stuff is just ignored.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2017 07:10 AM
What's the big deal? Exactly. I know 😕 We added a new field to a table and for some reason their system is throwing an axis error (Error getting Incident from ServiceNow Error: org.apache.axis2.databinding.ADBException: Unexpected subelement u_applied_template) over that element (even though we've added more than that one, it's the one causing an error for some reason). I told them to just ignore it, it's not needed for anything on their end, but they want to go through the whole process of re-downloading the WSDL and rebuild their object. I was thinking about using glide.soap.omit_null_values as this field should (should!) always be empty when they are querying the table.
So, I really see 3 options here:
- They can re-download the WSDL and redeploy.
- I can turn on that sys property, but of course that's a global setting—could be risky.
- They can code it on their end and just ignore the element.
Fair assessment?