Web Service XML Return is turning Tags to HTML Entities

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:

  1. $.ajax({
  2.         url: '../DSMO/lb.asmx/GetAvailableDocListAuth',
  3.         cache: false,
  4.         type: 'POST',
  5.         traditional: false,
  6.         dataType: 'text/xml; charset=utf-8',
  7.         data: {'AuthenticationCode' : 'IWontGiveThisInForum'},
  8.         success: function (msg, status, xmlHttpReq ){
  9.             var xml = xmlHttpReq.responseXML;
  10.         },
  11.         error: function (e) {
  12.             console.debug(e);
  13.         }
  14.    
  15.     });


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 ('&lt;' and '&gt;') 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