Timeouts on GetRequestStream()

J

James Delides

I've created a proxy to a set of webservices using the WSDL.exe tool on the
WSDL definitions (Using Visual Studio 2003 and the v1.1.4322 .NET Framework
on a Windows 2003 server box). The webservices have an additional layer of
security on them which requires me to provide a session cookie when
submitting a request. If the cookie is not present or expired an exception
will be raised, and I need to submit a security certificate and follow a
bunch of redirects to get a new session cookie.

All of the above is working fine, and I am calling the proxy from within a
Windows service. I've got a timer set to 5 minutes which opens a new thread
(or joins the existing one if it's still open) and accesses the webservices
through the proxy for every job it needs to submit.

The problem I'm having is that after a while all calls to the webservice
result in the following exception: "The operation has timed-out."

at System.Net.HttpWebRequest.GetRequestStream()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)

This results in the need for a restart of the service, after which it
immediately starts working fine again. After many hours of googling the only
thing that seems to have helped me at all was editing the machine.config
file, and increasing the maximum number of connections in the
<connectionManagement> element. It has been a lot better since then, but it
only seems to increase the threshold of where the problem occurs. If I
purposely break the cookie many times in a short space of time I am able to
reproduce the timeout.

It's almost as if the web request connections aren't being closed properly
when I invoke a method in the proxy (using netstat at the command prompt
shows a number of connections in the CLOSE_WAIT state at the time of the
problem). Does anyone have any suggestions on what I could do to fix this
problem?

Thanks in advance,

James
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top