473,372 Members | 883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

Old Exception but new Headache - The underlying connection was closed: An unexpected error occurred on a receive

I am getting the following exception when using webservice..
"The underlying connection was closed: An unexpected error occurred on a receive"
I am not getting any innerexception so no clue for the reason.

While i was seaching on web, i found the solutions but its not working for me.

I have already override the method on client proxy [Reference.cs] but its not working,
protected override System.Net.WebRequest GetWebRequest(Uri uri)
System.Net.HttpWebRequest objWebRequest =
(System.Net.HttpWebRequest) base.GetWebRequest(uri);
objWebRequest.KeepAlive = false; //Here i tried with true, but still not working
objWebRequest.ProtocolVersion = HttpVersion.Version10; //Here i tried removing this line, but still not working
objWebRequest.Timeout = 6000000; //Here i have tried with System.Threading.Timeout.Infinite but still not working
return objWebRequest;

My web service call scenario is:
- My webservice is used to send mail
- The mail attachment can be up to 10 MB [I have override Machine.Config setting for max request length of 4 MB and put "<httpRuntime executionTimeout="600" maxRequestLength="10240"></httpRuntime>" in web.config of webservice]
- If mail size is large then process takes long time [thats why i used TimeOut.Infinite]
- I noted a consitent behavior that it gives the above exception after 135 Seconds aprox.
- Even if with default maxRequestLength of 4MB, i have tried to send 3 MB mail but its not working
- For small size of mail attachment [<1MB] its working fine without any exceptions

Can anyone give me helping info or pointers please?

Thanks in Advance,

Mahesh Devjibhai Dhola
Jul 25 '06 #1
0 1540

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

Similar topics

by: Angel | last post by:
I'm trying to connect to a fixed IP address (eg. http://10.60.903.50/TempFile) in order to retrieve one accii line of text in TempFile. I try to read the information with this code: string...
by: Rajeev Tipnis | last post by:
http://support.microsoft.com/default.aspx?scid=kb;en- us;819450 Questions: 1) Is this patch (fix) applicable to the .NET 1.1 Framework as well? That is, if we have Framework 1.1 (On...
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...
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...
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...
by: matt | last post by:
hello, i am using a .NET 1.1 winform to perform webrequests via the System.Net.WebClient class (not a webservice, actually). It uploads values via a POST command & a URL, then receives the html...
by: pinky | last post by:
Hi all I am having one web service where in at a time of calling one webmethod through client application i am continuously getting following error :- The underlying connection was...
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...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.