none
Wcf cant hande large list

    Question

  • 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!

    Monday, March 14, 2011 7:22 AM

Answers

  • 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 Luo Friday, March 18, 2011 8:25 AM
    Monday, March 14, 2011 9:19 AM

All replies