Re: The underlying connection was closed: An unexpected error occurred on a receive

From: RK (r_adhakrishna_at_yahoo.com)
Date: 11/03/04


Date: 3 Nov 2004 06:14:48 -0800

We had this problem earlier, but the fix in microsoft kb819450 worked
for us.
In our case C# class library is making call to web service.. so we
created wrapper class and added the following code in it..

class classWebServiceWrapper:myWebService
    {
        protected override WebRequest GetWebRequest(Uri uri)
        {
            HttpWebRequest webRequest =
(HttpWebRequest)base.GetWebRequest(uri);
            webRequest.KeepAlive = false;
            return webRequest;
        }
    }

so inside the class library instead calling web service directly, call
wrapper class as follows

myWebService ws = new classWebServiceWrapper();

ps:
protected override WebRequest GetWebRequest(Uri uri)
        {
            HttpWebRequest webRequest =
(HttpWebRequest)base.GetWebRequest(uri);
            webRequest.KeepAlive = false;
            return webRequest;
        }
Adding this code in reference.cs file is also worked for us. but
everytime adding this part of the code is little extra work, so we
were using wrapper class.

goodluck.
--RK

    Guest <Guest@aew_nospam.com> wrote in message news:<OnKxYcXwEHA.1408@TK2MSFTNGP10.phx.gbl>...
> > We are running IIS 6 on Win2003, with .Net 1.1. I have a client that
> > talks to my Web Service. The Web Service call is pretty lengthy (can
> > take more than a few minutes to complete).
> >
> > I noticed when the web service call takes more than ~180 seconds to
> > complete, the client will get the above exception. I tried calling
> > both synchronously and asynchronously call and they both failed with
> > the same error.
> >
> > If I increase the "Connection timeout" in the IIS Manager for the web
> > site, I can increase the time before the client will get the
> > exception. However, I don't expect the IIS to timeout my client
> > connection since the client is waiting for the server to complete the
> > call. I set the client side timeout to a huge number (int.MaxValue). I
> > tried WinXP with .Net 1.1 and I didn't have this error.
> >
> > I tried Q819450 but it didn't help. I cannot turn off Keep-alives
> > because I use Integrated Windows Authentication.
> >
> > Anyone know what might be the problem here?
> >
> > Thanks,
> > Joel
>
> Hello,
>
> You are describing exactly the same problem we have.
> Our webservice takes also long time to finish. If we are running on WinXP with IIS 5.1, there is no problem, but on Windows2003 with IIS 6.0, the client gets an exception.
> I tested with the 'turn-off keep-alives', but the problem was not resolved.
>
> Did you find any solution?
> Regards,
> Eric
>
> User submitted from AEWNET (http://www.aewnet.com/)



Relevant Pages

  • RE: Hide StackTrace
    ... Since you're developing on an XML Web Service, ... Because when the web service throws an exception and was not ... It only returns a status code to the client. ... "This posting is provided "AS IS" with no warranties, ...
    (microsoft.public.dotnet.xml)
  • SOAP attachments Question
    ... attachment to a web service ... On the client response, when I count the number of attachments, it ... public void displayMessagethrows Exception ...
    (comp.lang.java.programmer)
  • WebServices exceptions
    ... but my understanding of an article I ... read on the MSDN site is, if you throw an exception in a web service, the ... the SoapException is thrown on the client. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • RE: An strange exception (WSE1.0 SP1)
    ... In my case it turned out that the problem was actually an exception being ... I discovered this by regenerating the client code as a non-WSE client, ... trying to invoke the web service; this revealed the exception that was ... > at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: Got 403 error after the first call to a web service
    ... I repeated the first call twice in a try catch, ... exception is being thrown by the service. ... Is this a normal, ASP.NET "ASMX" web service? ... Is there anything unusual about the service itself, or about the client? ...
    (microsoft.public.dotnet.framework.webservices)