Here is fragment of my code and config files:
proxy.ServicesClient client = new proxy.ServicesClient();
var result = client.GetCustomers(); // here throws ('ComunicationException was unhandled by user code: The underlying connection was closed: The connection was closed unexpectedly.')
In my app.config
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
contract="proxy.IServices" name="BasicHttpBinding_IServices" />
In Web.Config
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647">
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="214748364"
maxNameTableCharCount="2147483647"/>
Did you have this problem on WCF Services?
Note: It dose not work with large amount of data. In this case I have about 847 000 records in table. It works with small data perfectly(with about 5000 - 6000 records)
Jignesh TrivediPosted Mar 29, 2013, 7:39 AM
hi,
when ever you take reference, wcf also create client setting with in web.config/app.config (WPF application)
so check this setting and try after Increase Limit data and time out also set maxBufferSize and maxReceivedMessageSize to int.maxvalue (2147483647).
sorry i cannot access you URL due to some security reason.
hope this will help you
West SiderPosted Mar 28, 2013, 5:01 AM
2. Not EF, Ado net
3. I think yes. If not it should not work with small data, but works;
4. Yes custom
I uploaded this simple project here can you check it http://www.mediafire.com/?pdd99yyju2b4rjp
Jignesh TrivediPosted Mar 28, 2013, 4:23 AM
can you please share some information like
1) how you call your WCF from WPF 9are you use channel factory or take referance to your project?)?
2) what technology is used as DAL (entity framework or else)?
3) are you hosted your WCF on iis?
- it might be problem of bypass proxy with in LAN setting.
4) please share your result type. is it a custom DTO or datatable or else?
West SiderPosted Mar 28, 2013, 3:52 AM
I don't use enums in this case. And All type include Class and it's properties has serializable atribute
West SiderPosted Mar 28, 2013, 3:49 AM
Database connection is well, because I debug it and all record retrieved from SQL server to my DAL; And whats about server connection there is problem, but not in time out, because this Exception rises during 5-10 seconds, after I call from client this service function. This links you post did not help me at all but anyway thanks
Anil KumarPosted Mar 28, 2013, 12:26 AM
Refer: http://www.c-sharpcorner.com/Blogs/11126/the-underlying-connection-was-closed-the-connection-was-clo.aspx
Jignesh TrivediPosted Mar 28, 2013, 12:19 AM
this problem might come due to database connection time out or transaction time out or server connection time out.
please refer below link
http://weblogs.asp.net/jan/archive/2004/01/28/63771.aspx
http://www.codeproject.com/Tips/326059/The-underlying-connection-was-closed-The-connectio\
it might help to resolve your issue.
can you please share code for client.GetCustomers(); methods