sachitjain
asked on
Status of XMLHTTPRequest object is 12031 on call of its Send method
I have a JS function that takes input parameters as URL and some input XML, it then instantiates an object (xmlhttp) of type "MSXML2.XMLHTTP.6.0" and calls its Send method with given input parameters. Most of the times function runs well but sometimes it gives status of object as 12031 instead of 200. Any clues why this error is occuring and what could be the possible remediation to handle it or avoid it?
function SendXmlHttp(sURL, sSendXml)
{
	try
	{
		var xmlhttp = new ActiveXObject("MSXML2.XMLH TTP.6.0");
		// cursory check of the XML - make sure it has an XML declaration
		var lsXml = checkXmlBeforeSend(sSendXm l);
	
		xmlhttp.Open("POST ", sURL, false);
		xmlhttp.setRequest Header("Co ntent-Type ", "application/x-www-form-ur lencoded") ;
		xmlhttp.send(lsXml );
......................
function SendXmlHttp(sURL, sSendXml)
{
	try
	{
		var xmlhttp = new ActiveXObject("MSXML2.XMLH
		// cursory check of the XML - make sure it has an XML declaration
		var lsXml = checkXmlBeforeSend(sSendXm
	
		xmlhttp.Open("POST
		xmlhttp.setRequest
		xmlhttp.send(lsXml
......................
ASKER
Badotz
Thanks for inputs but unfortunately these did not help! :-(
Actually we are migrating one ASP application to ASP.Net and this is JS portion on one common JS file. In it URL parameter now is .ASPX not .ASP. With .ASP URLs this function never returns any such exception.
Thanks for inputs but unfortunately these did not help! :-(
Actually we are migrating one ASP application to ASP.Net and this is JS portion on one common JS file. In it URL parameter now is .ASPX not .ASP. With .ASP URLs this function never returns any such exception.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Found this:
/*
IE status Property Value Corresponding statusText Value
12002 ERROR_INTERNET_TIMEOUT
12007 ERROR_INTERNET_NAME_NOT_RESOLVED
12029 ERROR_INTERNET_CANNOT_CONNECT
12030 ERROR_INTERNET_CONNECTION_ABORTED
12031 ERROR_INTERNET_CONNECTION_RESET
12152 ERROR_HTTP_INVALID_SERVER_RESPONSE
*/
ASKER
I am using IE6 only. Interestingly ASP application with same browser never gives any such exception in same JS code but migrated ASP.Net application gives this exception seldom with same JS code.
I already found status text against this status code 12031 but not root cause or fix unfortunately. :-(
I already found status text against this status code 12031 but not root cause or fix unfortunately. :-(
The only clue here is "ERROR_INTERNET_CONNECTION _RESET" - perhaps your server is flaking?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do you use a wi-fi connexion ?
Open command line and run a ping to your server (update server_adress with your server address) :
Open command line and run a ping to your server (update server_adress with your server address) :
ping server_adress -n 1000000
ASKER
leakim971
Its not Wi-fi connection.
gurvinder372:
Thanks for sharing these links. Actually the scenario is link a page is there that populates the list of pending of notifications of user and refreshes itself periodically by sending an asynchronous request to an ASPX page. The ASPX page in turn would call COM+ services to fetch latest list of notifications from the server and post it back to client. I am suspecting that irregular behavior by COM+ services might also cause connection reset to client but don't have enough evidence to prove it. As suggested in your first link, I don't think size of response is an issue here because 8 out of 10 times the notification page refreshes perfectly. It causes issues for hardly 2 of the 10 times.
I would keep you guys posted with my findings but please provide any other pointer if you think like I might be missing in my analysis.
Its not Wi-fi connection.
gurvinder372:
Thanks for sharing these links. Actually the scenario is link a page is there that populates the list of pending of notifications of user and refreshes itself periodically by sending an asynchronous request to an ASPX page. The ASPX page in turn would call COM+ services to fetch latest list of notifications from the server and post it back to client. I am suspecting that irregular behavior by COM+ services might also cause connection reset to client but don't have enough evidence to prove it. As suggested in your first link, I don't think size of response is an issue here because 8 out of 10 times the notification page refreshes perfectly. It causes issues for hardly 2 of the 10 times.
I would keep you guys posted with my findings but please provide any other pointer if you think like I might be missing in my analysis.
>Its not Wi-fi connection.
OK, run the ping and browse the site, it may help you to know if you've a connexion problem with the server.
OK, run the ping and browse the site, it may help you to know if you've a connexion problem with the server.
Which is what I suggested in http:#a4523087...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
No worries - glad to help.
var xmlhttp = getXmlHttp(); // Get the proper XHR object for all browsers
Open in new window