views:

1537

answers:

3
+1  A: 

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
Chris
A: 

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.

Jonathan Lonowski
I have verified the XML File and Even the response is coming properly when I am accessing the File from my local FileSystem Like C:/CallWebService.html

related questions