Web Service XML Return is turning Tags to HTML Entities
Hello Everyone,
I am losing my marbles trying to figure this one out.
I am using the ajax method in JQuery to return an XML response from a URL location. The method looks like the following:
- $.ajax({
- url: '../DSMO/lb.asmx/GetAvailableDocListAuth',
- cache: false,
- type: 'POST',
- traditional: false,
- dataType: 'text/xml; charset=utf-8',
- data: {'AuthenticationCode' : 'IWontGiveThisInForum'},
- success: function (msg, status, xmlHttpReq ){
- var xml = xmlHttpReq.responseXML;
- },
- error: function (e) {
- console.debug(e);
- }
-
- });
OK so if I use repsonseText responseXML or just try and traverse msg it will not work. The problem is the body of my XML response, all of the tags ('<' and '>') are getting escaped to html entities ('<' and '>') So it becomes a malformed XML document that is not readable. I even tried using the Javascript function replace to go through and replace with no luck.
Even stranger if I access the web service through the browser, the XML is just fine!
The server is Windows Server 2008 running IIS 7 and I am programming of course in HTML and newest version of JQuery.
The browser I am testing on is Firefox with FireBug.
Any ideas are greatly appreciated
Tom