Escape XML Characters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2011 11:29 AM
Hello,
I have an XML SOAP request that gets sent out regularly to an external vendor. Our vendor is saying that we need to HTML encode our apostrophes in our messages. These show up in user last names such as O'Donnell.
I have tried to replace the apostrophe characters using the following code:
//FILTER OUT SPECIAL CHARACTERS FOR XML REQUEST
var apostrophe = "'";
defaultReporterFirstName = defaultReporterFirstName.replace(/'/g, apostrophe);
defaultReporterLastName = defaultReporterLastName.replace(/'/g, apostrophe);
The issue now is it appears that Service Now is HTML encoding the ampersand character at the beginning of the string, but this is breaking the HTML encoding for the apostrophe.
O'DonnellWeb Ticket
Is there a way I can HTML encode apostrophe characters in XML?
Thanks!
Mark Didrikson
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2011 09:53 AM
Thanks John. Those don't seem to be working either. I'm going to see if we can filter out the apostrophe.
Thanks again.
Mark Didrikson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2012 06:29 AM
If you haven't already solved this, there was a new feature added to SOAP Message the middle of last year. Chris Maloy created a blog post about it earlier this week. It may apply to your situation:
http://community.service-now.com/blog/christophermaloy/using-setparameter-setstringparameter-setxmlparameter-when-using-soapmessage-c
We now have a function that allows you to insert a string or xml into a SOAP Message Parameter.