> On Jan 31, 2:23 pm, "Hiten" <hitendr@gmail.com> wrote:
> > Can any answer why it dosent work in FireFox and it works fine in IE
> Do not know exactly why but you can try to sniff HTTP requests using
> software like Ethereal and compare what IE sends and what FF sends.
Hi
I have created one application which is calling web service [Written
C# & ASP.Net] by XMLHttpRequest or Microsoft.XMLHTTP [In case of IE].
Following is the code which works fine with IE 6 but when i am
browsing the same page on
Firefox it is giving following error.
"System.Web.Services.Protocols.SoapException.Server was unable to
process request.---> the root element is missing."
function loadXMLDoc(url) {
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
req.onreadystatechange = processReqChange;
req.open("POST", url, true);
req.send(null);
} else if (window.ActiveXObject) {
isIE = true;
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = processReqChange;
var url1="<?xml version='1.0' encoding='utf-8'?
instance' xmlns:xsd='
http://www.w3.org/2001/XMLSchema' xmlns:soap12='
http://www.w3.org/2003/05/soap-envelope'>"+
"<soap12:Body><HelloWorld xmlns='http://
tempuri.org/'>"+
"<name>hellohello</name>"+
"</HelloWorld>"+
"</soap12:Body></soap12:Envelope>";
req.open("POST", url, true);
req.setRequestHeader("Man", "HTTP/1.1 200 OK");
req.setRequestHeader("Host", "localhost:8919");
req.setRequestHeader("Content-Type", "application/soap
+xml; charset=utf-8");
req.setRequestHeader("Content-Length", url1.length );
req.setRequestHeader("SOAPAction", "
http://tempuri.org/ HelloWorld");
req.send(url1);
}
}
}
function processReqChange()
{ if(req.status==200)
{
alert(req.responseText); //This is the line where error is coming.
}
}
Can any answer why it dosent work in FireFox and it works fine in IE
------
Hitendra Patel
-----------------------------------------------Reply-----------------------------------------------