WebException: The underlying connection was closed

Hi

After upgrading our win client app to run on version 2.0 of the .net framework (prev. v1.1) on of our customers reports the following error when calling a web service on our server:

System.Net.WebException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.

The customer is using a proxy-server, but it worked fine before the upgrade, and other customers who are behind proxy-servers has no problems.

The error does not occur when the customer accesses the web service using Internet Explorer.

The customer is behind a firewall.

/Daniel



Answer this question

WebException: The underlying connection was closed

  • Zaracattle

    This has nothing to do with your ISP. Again I also don't have a solution, but what it looks like is that there is some parameter "keep-alive" which sets an expectation that the connection will not be closed when the next request is made. So when you make the request for the first time you will get a response back, and if you make the next request within lets say n seconds you will still get a response after that you will get this error. Then again when you make another request it will go through.


  • Philippe Galipeau

    This is not an answer, but similar problem. Having the same problem using .net remoting with IIS hosting. The only thing we can figure is it has something to do with a satellite connection using Huges.net

    Will keep you posted


  • axl

    We still haven't found a solution to this. We're more or less certain that it has to do with their firewall/proxy - the web service request never reaches the server. But why does the exact same code compiled with version 1.1 of the framework work fine, while compiling with version 2.0 gives the above error

    Any hints would be appreciated.

    /Daniel


  • WebException: The underlying connection was closed