Views: 33K
Replies: 5
Archived
|
WCF - Large Data send to clientI added 1,3000 records in customer table in Patterns in Action 4.0 sample. When I run the sample, WCF timeout error occurred.
I modified the maxReceivedMessageSize="2147483647", maxStringContentLength="81920" and sentTimeOut="00:10:00", but did not work. So, I would like to know how to handle the large data return from WCF to client? Emily Fong, Feb 09, 2011
|
|
Reply 1Consider reading the official MS documentation about large data and streaming in WCF.
It highlights some general concerns and considerations for encodings, binary data, and streaming that generally apply to connected systems infrastructures.Alexander Molinari, May 31, 2011
|
|
Reply 2I have faced similar things and the following things work for me.
// Change the values in no. as required. maxBufferPoolSize=”100000” maxBufferSize = “100000” maxReceivedMessageSize=”100000” <behaviors> <behavior name="YourServiceBehavior"> <dataContractSerializer maxItemsInObjectGraph="200000" /> </behavior> </behaviors> On more thing... Set the OperationTimeout on the IChannel proxy interface as follows... I am unable to find a config setting for the same. // This can be done while creating the proxy ((IContextChannel)base.Channel).OperationTimeout = timeout; For e.g. public partial class ServiceFooClient : ClientBase<IServiceFoo>,IServiceFoo { public IServiceFoo SetOpTimeout(TimeSpan timeout) { ((IContextChannel)base.Channel).OperationTimeout = timeout; } } Hope this helps....
|
|
Reply 3Well, one could ideally use the MTOM encoding with the WCF to transfer large objects. The below link would be able to help you out on this.
http://msdn.microsoft.com/en-us/library/aa395209.aspx Abishek Srikaanth, Mar 01, 2011
|
|
Reply 4Maybe you can try to set max value for maxItemsInObjectGraph behavior both server and client side.
<behaviors> <endpointBehaviors> <behavior> <dataContractSerializer maxItemsInObjectGraph="2147483646" /> </behavior> </endpointBehaviors> </behaviors> Melih Yurtsever, Feb 18, 2011
|
|
Reply 5There are a several timeout setting not only the sentTimeOut, always remember that just because you don't see a setting doesn't mean it doesn't exist. Note the various Timeout settings here: <binding name="WSHttpBinding_ITimeOutDemoService" closeTimeout="00:10:00" There is also the executionTimeout in the web.config which is set under configuration - system.web - httpRuntime executionTimeout as shown below. <configuration> Note that 600 is 10 minutes. Then remember that if IIS is hosting the WCF Service there are timeout settings which need to be managed there as well. This is certainly not all there is to know about TimeOut settings but I hope this points you in the right direction. Good luck Emily
Ricky Owen, Feb 10, 2011
|