all groups > dotnet web services > january 2008 >
You're in the

dotnet web services

group:

The underlying connection was closed: An unexpected error occurred



The underlying connection was closed: An unexpected error occurred John
1/31/2008 11:57:02 AM
dotnet web services: Calling a .net 2.0 web service, get "The underlying connection was closed: An
unexpected error occurred on a receive."

I have tried everything I have found on the web. The httpRequest override,
disabling keep alives, increasing timeout etc, etc..

I have a client app that calls the web service. If I make multiple calls in
a for loop then all is well. If I create worker threads (using
queueuserworkitem) I get this error after several calls. The problem seems
related to the length of time the calls take, shorter ops get thru more calls
than longer ones.

Can anyone help?

Thanks

-j
RE: The underlying connection was closed: An unexpected error occurred John
1/31/2008 12:03:01 PM
Forgot to say, If I increase the timeout in iis then I get a 403 error
instead of this...

[quoted text, click to view]
RE: The underlying connection was closed: An unexpected error occurred blackpope
1/31/2008 12:08:04 PM
proxies maybe? I had the same problem a while back and solution was using a
webproxy class and authenticating with it first. preauthenticate i think it
is...

[quoted text, click to view]
RE: The underlying connection was closed: An unexpected error occu John
1/31/2008 12:46:02 PM
Thanks for the info... Still no luck tho :-(


[quoted text, click to view]
RE: The underlying connection was closed: An unexpected error occu John
1/31/2008 1:55:00 PM
I added the following to the proxy....

protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
System.Net.HttpWebRequest webRequest =
(System.Net.HttpWebRequest)base.GetWebRequest(uri);

webRequest.KeepAlive = false;
webRequest.ProtocolVersion = System.Net.HttpVersion.Version10;

return webRequest;
}

which has made it a lot better. Now I get 403 intermittently....


[quoted text, click to view]
AddThis Social Bookmark Button