System.Net.WebException: The underlying connection was closed: An

Discussion in 'ASP .Net Web Services' started by Edgar@CCrane, Jun 17, 2004.

  1. Edgar@CCrane

    Edgar@CCrane Guest

    I have developed a web application using VB.NET 2003 under the .NET 1.1 Framework and along with that application I also included a web service which will be an entry point for a VB.NET application to update certain data in the web site. The problem that we have recently encounted is that at random times it will throw a "System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send." exception. I have read the previous postings and it seems that there is no solution for this bug at this time. Is this correct?
     
    Edgar@CCrane, Jun 17, 2004
    #1
    1. Advertising

  2. Edgar@CCrane

    Jan Tielens Guest

    This problem is discussed in the following post:
    http://weblogs.asp.net/jan/archive/2004/01/28/63771.aspx

    It comes down to overriding the GetWebRequest method of the generated proxy
    class.

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

    --
    Greetz
    Jan
    ________________
    Read my weblog: http://weblogs.asp.net/jan


    "Edgar@CCrane" <Edgar@> schreef in bericht
    news:...
    > I have developed a web application using VB.NET 2003 under the .NET 1.1

    Framework and along with that application I also included a web service
    which will be an entry point for a VB.NET application to update certain data
    in the web site. The problem that we have recently encounted is that at
    random times it will throw a "System.Net.WebException: The underlying
    connection was closed: An unexpected error occurred on a send." exception.
    I have read the previous postings and it seems that there is no solution for
    this bug at this time. Is this correct?
     
    Jan Tielens, Jun 17, 2004
    #2
    1. Advertising

  3. Re: System.Net.WebException: The underlying connection was closed:

    I had actually read your postings Jan, but it must of been too late in the afternoon because it did not register. This morning I transfered your function into a VB.NET function and here it is for those of you using VB

    Protected Overloads Function GetWebRequest(ByVal Uri As Object)
    Dim webRequest As System.Net.HttpWebRequest = MyBase.GetWebRequest(Uri)
    webRequest.KeepAlive = False
    Return webRequest
    End Function

    Thanks Jan

    --
    Assistant IT Manager
    C. Crane Company
    http://www.ccrane.com
    (800)522-8863


    "Jan Tielens" wrote:

    > This problem is discussed in the following post:
    > http://weblogs.asp.net/jan/archive/2004/01/28/63771.aspx
    >
    > It comes down to overriding the GetWebRequest method of the generated proxy
    > class.
    >
    > protected override System.Net.WebRequest GetWebRequest(Uri uri)
    > {
    > System.Net.HttpWebRequest webRequest =
    > (System.Net.HttpWebRequest) base.GetWebRequest(uri);
    > webRequest.KeepAlive = false;
    > return webRequest;
    > }
    >
    > --
    > Greetz
    > Jan
    > ________________
    > Read my weblog: http://weblogs.asp.net/jan
    >
    >
    > "Edgar@CCrane" <Edgar@> schreef in bericht
    > news:...
    > > I have developed a web application using VB.NET 2003 under the .NET 1.1

    > Framework and along with that application I also included a web service
    > which will be an entry point for a VB.NET application to update certain data
    > in the web site. The problem that we have recently encounted is that at
    > random times it will throw a "System.Net.WebException: The underlying
    > connection was closed: An unexpected error occurred on a send." exception.
    > I have read the previous postings and it seems that there is no solution for
    > this bug at this time. Is this correct?
    >
    >
    >
     
    Edgardo G. Diaz, Jun 17, 2004
    #3
  4. Can you give some more data about your application ?

    Are you using authentication of some sort ?

    feroze
    =========
    "Edgar@CCrane" <Edgar@> wrote in message
    news:...
    > I have developed a web application using VB.NET 2003 under the .NET 1.1

    Framework and along with that application I also included a web service
    which will be an entry point for a VB.NET application to update certain data
    in the web site. The problem that we have recently encounted is that at
    random times it will throw a "System.Net.WebException: The underlying
    connection was closed: An unexpected error occurred on a send." exception.
    I have read the previous postings and it seems that there is no solution for
    this bug at this time. Is this correct?
     
    feroze [msft], Jul 1, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    2,847
    Kevin Spencer
    Sep 30, 2005
  2. Steven Cheng[MSFT]
    Replies:
    4
    Views:
    1,671
    Steven Cheng[MSFT]
    Apr 8, 2004
  3. Steven Harris
    Replies:
    0
    Views:
    197
    Steven Harris
    Aug 14, 2003
  4. Jeremy Ames
    Replies:
    1
    Views:
    283
    Jeremy Ames
    Jan 8, 2004
  5. Rob Snell
    Replies:
    5
    Views:
    471
    Joel Zhou
    Sep 28, 2004
Loading...

Share This Page