473,545 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.Net.WebE xception: The underlying connection was closed: An unexpected error occurred on a send.

When I invoke two web service methods sequentially with no delay, the first
web method invocation goes smooth while the 2nd one generates the dredded:

System.Net.WebE xception: The underlying connection was closed: An unexpected
error occurred on a send.

The only way I have been able to make consecutive web method invocations
work is by overriding GetRequest and disabling Keep-Alive. The IIS
Keep-Alive setting is enabled for 120 seconds but yet it appears that value
is not being honored by IIS for some reason. I would rather not disable
keep alive to make things work as doing so has network performance
implications. Has anyone gotten Http Keep-Alives to work in .NET 2.0?

Server = Win 2003 SP2 / .NET 2.0

Client = Win XP SP2 / .NET 2.0

thanks

ScottM
Jun 8 '07 #1
2 5865
Ok, for anyone interested, I solved the issue. At the time of the
WebException, I happened to be running Fiddler 2.0.9.0. Fiddler
automatically reconfigures IE proxy settings to support HTTP tracing.
Apparently, this version of fiddler has issues with HTTP-Keep alive. I
turned off Fiddler, re-ran my code and all is well.
ScottM
"Scott McFadden" <no************ **@criticaltech .comwrote in message
news:Oh******** *****@TK2MSFTNG P02.phx.gbl...
When I invoke two web service methods sequentially with no delay, the
first web method invocation goes smooth while the 2nd one generates the
dredded:

System.Net.WebE xception: The underlying connection was closed: An
unexpected error occurred on a send.

The only way I have been able to make consecutive web method invocations
work is by overriding GetRequest and disabling Keep-Alive. The IIS
Keep-Alive setting is enabled for 120 seconds but yet it appears that
value is not being honored by IIS for some reason. I would rather not
disable keep alive to make things work as doing so has network performance
implications. Has anyone gotten Http Keep-Alives to work in .NET 2.0?

Server = Win 2003 SP2 / .NET 2.0

Client = Win XP SP2 / .NET 2.0

thanks

ScottM


Jun 8 '07 #2
I had the same problem and it was resolved after closing Fiddler.
I was looking for someone to confirm that Fiddler really was the culprit.
Thanks !

"Scott McFadden" wrote:
Ok, for anyone interested, I solved the issue. At the time of the
WebException, I happened to be running Fiddler 2.0.9.0. Fiddler
automatically reconfigures IE proxy settings to support HTTP tracing.
Apparently, this version of fiddler has issues with HTTP-Keep alive. I
turned off Fiddler, re-ran my code and all is well.
ScottM
"Scott McFadden" <no************ **@criticaltech .comwrote in message
news:Oh******** *****@TK2MSFTNG P02.phx.gbl...
When I invoke two web service methods sequentially with no delay, the
first web method invocation goes smooth while the 2nd one generates the
dredded:

System.Net.WebE xception: The underlying connection was closed: An
unexpected error occurred on a send.

The only way I have been able to make consecutive web method invocations
work is by overriding GetRequest and disabling Keep-Alive. The IIS
Keep-Alive setting is enabled for 120 seconds but yet it appears that
value is not being honored by IIS for some reason. I would rather not
disable keep alive to make things work as doing so has network performance
implications. Has anyone gotten Http Keep-Alives to work in .NET 2.0?

Server = Win 2003 SP2 / .NET 2.0

Client = Win XP SP2 / .NET 2.0

thanks

ScottM


Jun 18 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1584
by: Jonathan Crowther | last post by:
On one PC the following test code results in an error on the GetResponse line while it works OK on another PC. The only difference that I am aware of is that the one that works is XP while the problem occurs on Windows 2000. I have tested that the Internet connection is OK through IE. Does anyone know what the problem could be? The error is:...
5
9005
by: Sachin Surana | last post by:
We use HttpWebRequest to send the request at a URL. But some times the method GetResponse throws a time out exception. But when we check the IIS logs, there is no such entry. So the request never reached the server but the client is getting a time out exception. What could be the possible reasons? Confirmed that the request does not get...
1
8816
by: Fredrik L | last post by:
Hi, We have an application outside the firewall who talks to a webservice inside the firewall. 9 times of 10 this works, but sometimes we got the error "The underlying connection was closed: An unexpected error occurred on a receive." We have tested some of the solutions that we have found in this discussion group but the problem still...
5
24735
by: Vijayakrishna Pondala | last post by:
Hi, We are using the following error randomly, when accessing a webservice method/servlet hosted on JBoss application server: The underlying connection was closed: An unexpected error occurred on a receive. We are using .NET v1.1.
4
20474
by: Matthew.DelVecchio | last post by:
hello, i am developing an ASP.NET web app that consumes a 3rd party vendor webservice. it is my first one so while ive done my homework, im not an expert on the matter. our partner's webservice operates on SSL via an "https://" url. they also gave me a .PFX certificate which ive installed via window's MMC utility, into the "Computer...
5
12786
by: Tim Reynolds | last post by:
My app calls a web service. After a few minutes of inactivity, we receive: System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. A call directly after this works fine with no exception. How can I keep this exception from occuring in the first place?
0
2641
by: Seth Thibodeaux | last post by:
I have built a Windows Service that connects to Sql Server 2000 Reporting Services via its Web Service interface for the purpose of generating reports. Intermittently, calls made to the Web Service result in WebExceptions indicating that the underlying connection was closed. We are running the application on a box running W2k3 (no SP) and...
3
4059
by: Rahul Anand | last post by:
As per our requirements we have a web service which internally connects (Simple HTTP Post Request) to a remote server to initiate some work. We are calling the web service method asynchronously from a .NET Web Application hosted on IIS. In our setup the web request form a client can be running for long duration (may be more than 4 hours). ...
2
2958
by: zolof | last post by:
Hi, I am trying to make a simple file updload WinForm app. Here's the code: WebClient webClient = new WebClient(); webClient.UploadFile(new Uri("http://localhost/WebSite/Upload.aspx"), "c:\\bin.zip"); My IIS 5.1 Web server uses default configuration. If the file is less than 5Mo everything works fine. If the file is too big I get this...
0
7393
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7653
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7803
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7411
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
4942
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3444
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3439
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1871
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.