Wcf cant hande large list
-
Monday, March 14, 2011 7:22 AM
Hello,
I have a wcf service, using tcp. it has a method which i always call asynchronously.
the method received an object with a list of long.
usually, the list is not so big, and everything is just fine. the problem is, that if i pass a big list, for example with more then 20,000 numbers, it cannot handle it.
it does not throw any exception, but the state turns into "Faulted" when the thread is completed, and on my next try to use the service of course i get an exception that the state is faulted.
i tried configuring the app.config of my client with max int values on every place with "max.." parameter (for example, in the maxArrayLength).
on the server side, i configured the behavior with:
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
Thanks alot!
All Replies
-
Monday, March 14, 2011 8:11 AM
Hi,
Try setting the max vaules in the binding configuration for the service as well.
Regards,
Alan
http://www.CloudCasts.net - Community Webcasts Powered by Azure- Edited by Alan Smith MVPMVP Monday, March 14, 2011 8:11 AM typo
-
Monday, March 14, 2011 8:30 AMHello, and thanks in advance for your help. I configured the maxItemsInObjectGraph in the service side to maximum. what should i configured except it? it could not find any parameter with "max.." in the service side.
-
Monday, March 14, 2011 9:19 AM
As Alan says try setting max size for netTcp Binding as below in service config
<bindings>
<netTcpBinding>
<binding name="largeObjects" maxReceivedMessageSize="5000000" maxBufferSize="5000000">
<readerQuotas maxArrayLength="5000000" maxStringContentLength="5000000"/>
</binding>
</netTcpBinding>
</bindings>
And add binding Configuration for end point as below
<endpoint bindingConfiguration="largeObjects"/>
If it didn’t work then enable tracing in WCF and see what the exact error is
http://msdn.microsoft.com/en-us/library/ms733025.aspx
-Vital- Proposed As Answer by NagaVital Friday, March 18, 2011 5:02 AM
- Marked As Answer by Yi-Lun LuoModerator Friday, March 18, 2011 8:25 AM
-
Monday, March 14, 2011 6:41 PM
It worked! thanks alot!
does is matter if i use those values as max values, or will i get better performance if i reduce the max values?
-
Tuesday, March 15, 2011 6:19 AM

