Last post Dec 21, 2009 11:31 PM by cindy998
May 25, 2007 07:08 AM|phil.net|LINK
I'm developing a webservice (and client) for synchronization of files. When I try to send big files, I always receive the following error:
The underlying connection was closed: An unexpected error occurred on a receive.
The file that i want to send is 80 MB big.
To solve this problem i maked this configuration in the web.config:
and in the metabase.xml I changed this (on production server and local machine):
on my local machine it works fine, but when I'm trying this with my production i receive the error. The error come after 30 seconds. I changed the connection timeout to 3600 seconds, too.
I have no idea, where it could be the problem. I need your help.
May 25, 2007 08:06 AM|blahhumbug|LINK
Have you tried tweaking the IIS settings? The default connection timeout is 120 seconds.
Here's an articles that explains a bit. It's normally for SharePoint, but the IIS settings section should be the same.
May 25, 2007 08:22 AM|phil.net|LINK
the connection timeout is set to 3600 seconds... In the article is described thath in share point server it exists a setting for the maximal upload.
Could it be this the problem? Should I change probably another property in the IIS metabase?
But I don't know which...
May 25, 2007 08:33 AM|blahhumbug|LINK
Did you look at this setting?
This is the one that I think could be the culprit.
May 25, 2007 08:40 AM|blahhumbug|LINK
look at the last post in this thread (http://communityserver.org/forums/t/481957.aspx) the post by ploeh.
May 25, 2007 08:59 AM|phil.net|LINK
Thanks for your quick response... I just changed the connection timeout of iis to 3600 seconds and the executiontimeout and maxrequestlength in the web.config, but it doesn't help...
May 25, 2007 09:07 AM|khalidzaheer|LINK
i m using webservices to access the data
that works fine
when data is sent from server against any request
it returns the data i needed even any column in any table contain white space like " "
but when i send the the data from client to server for updation
" " is replaced to "" for column value
this is causing alot of problems
does anyone know the solution please help
and thanx in advance
May 25, 2007 09:20 AM|blahhumbug|LINK
What is your production server config? IIS6? Server 2003?
Are you calling the service through a custom client (WinForm? WebForm?)
May 25, 2007 09:26 AM|phil.net|LINK
the production server is win server 2003 with iis 6.0 (with BITS extensions installed)...
the client is a windows form (.Net 2.0)....
May 25, 2007 09:28 AM|khalidzaheer|LINK
thanx for ur response
yes i m calling from windows client
actually problem occurs when we request dataset to update through data adapter
as u knw if orignal value not matchs the version in database it causes concurrency violation
if orignal value of column contains " " white spaces like this
it changes to "" which doesnt match with db version
in our appliation white spaces also has significance
currently we are using iis6.0
May 25, 2007 09:36 AM|phil.net|LINK
why don't you open your own thread for your problem?
May 25, 2007 09:42 AM|khalidzaheer|LINK
sory for interfaring
i have posted new thread but cant even see that in list
may b pending in the queque
i didnt find any response
may be my request is pending in the queue for administrator to have a look at it
May 29, 2007 03:04 AM|Young Fang - MSFT|LINK
To overcome the problem of sending large files via web services you can split a file into X number of file fragments, and then send them all to the server, where they would be combined to reproduce the original file on the server.
Here you can find sample code:
May 29, 2007 06:33 AM|phil.net|LINK
thanks for the response. I used a similar solution to resolve the problem temporary. Is there no other way to send larger files? The max. file size is 10 MB, when I try to send an higher file size, the connection would be closed. If I can send files up to
20 MB, I'm happy....
May 30, 2007 08:25 AM|Young Fang - MSFT|LINK
How about using the Message Transmission Optimization Mechanism (MTOM) specification for transmitting large amounts of data to and from Web services.
To send and receive the largest possible SOAP messages, you can set the value of the <maxMessageLength> element to -1.
Please have a look at below links for sample code:
Jun 01, 2007 10:50 AM|phil.net|LINK
Thanks a lot! I have installed WSE 3.0 and reconfigured the web.config. Now I'm able to send files with size up to 70 MB. I don't understand, because now the limit is by 70 MB, but it works. Another configuration, that didn't work is to set the maxMessageLength
(described in the MSDN article) to an higher value. It says that httpruntime don't support a property named "maxMessageLength"....
Oct 31, 2007 02:24 PM|TATWORTH|LINK
The link to the article on MSDN is now
Dec 21, 2009 11:31 PM|cindy998|LINK
I had the same error a week ago and I found a solution here :
There are several solutions for this. You can find the list of solutions here: