Since you're setting Content-type
, you need to also set it to use UTF-8
. And I think it's supposed to be application/xml
(source).
xmlhttp.setRequestHeader("Content-Type", "application/xml; charset=utf-8");
Otherwise, have you verified that the XML is properly formatted? Try saving it as a complete XML file and open it in your browser.
For Internet Explorer
http://www.simple-talk.com/dotnet/asp.net/calling-cross-domain-web-services-in-ajax/
For Firefox
http://installingcats.com/2008/01/29/how-to-fix-ajax-error-uncaught-exception-permission-denied-to-call-method-xmlhttprequestopen/
XmlHttpRequest can only be used to call services local to the domain/server from where the page is being served.
Thus, if you're serving a page from:
http://www.example.com/page1
You cannot make an XmlHttpRequest to:
http://www.sample.com/webservice