473,320 Members | 1,691 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,320 software developers and data experts.

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

Hi,
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,

Regards,
Mahesh Devjibhai Dhola
Jul 25 '06 #1
0 1539

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

Similar topics

1
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...
26
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...
1
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...
5
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...
4
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...
1
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...
0
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...
3
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.