R
Randy Danielson
Hello,
I am making an asynchronous call to a web service (not on my local
machine) from a asp.net project that is on my local machine. Then I am
looping and doing a thread sleep while waiting for the
result.IsCompleted.
Intermittantly I get the following error:
A first chance exception of type 'System.Net.WebException' occurred in
system.dll
Additional information: The remote server returned an error: (500)
Internal Server Error.
When I switch back to using the synchronous call I do not seem to have
this problem.
Here is my code that I am using for the asynchronous call:
WebReference.GTSWebOrderSvc webOrder = new WebReference.GTSWebOrderSvc
();
IAsyncResult result = null;
System.DateTime startTime = System.DateTime.Now;
result = webOrder.BeginProcessRequest(this.OuterXml, null, null);
while (!result.IsCompleted)
{
System.Threading.Thread.Sleep(500);
if (startTime.AddSeconds(10) < System.DateTime.Now)
throw new Exception("Request has timed out, web site is
unavailable");
}
return webOrder.EndProcessRequest(result);
I am using
dev environment 2003 ver. 7.1.3088
frame work 1.1 ver 1.1.4322 sp1
Any ideas on what is wrong here?
Thanks
Randy
I am making an asynchronous call to a web service (not on my local
machine) from a asp.net project that is on my local machine. Then I am
looping and doing a thread sleep while waiting for the
result.IsCompleted.
Intermittantly I get the following error:
A first chance exception of type 'System.Net.WebException' occurred in
system.dll
Additional information: The remote server returned an error: (500)
Internal Server Error.
When I switch back to using the synchronous call I do not seem to have
this problem.
Here is my code that I am using for the asynchronous call:
WebReference.GTSWebOrderSvc webOrder = new WebReference.GTSWebOrderSvc
();
IAsyncResult result = null;
System.DateTime startTime = System.DateTime.Now;
result = webOrder.BeginProcessRequest(this.OuterXml, null, null);
while (!result.IsCompleted)
{
System.Threading.Thread.Sleep(500);
if (startTime.AddSeconds(10) < System.DateTime.Now)
throw new Exception("Request has timed out, web site is
unavailable");
}
return webOrder.EndProcessRequest(result);
I am using
dev environment 2003 ver. 7.1.3088
frame work 1.1 ver 1.1.4322 sp1
Any ideas on what is wrong here?
Thanks
Randy