Return Big Service Data

I have a method that returns a large list of objects. When I return multiple objects (10), everything works fine. The problem is that I am trying to return 100 objects. The reason the list is so large is because the objects in the list have other objects inside, so I basically return the tree.

In any case, I use named pipes, and here is the configuration I use:

<netNamedPipeBinding> <binding name="NetNamedPipeBinding_ISymbolFileParser" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647" > <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="2147483647" /> </binding> </netNamedPipeBinding> 

When I limit the number of objects by doing results.Take(10).ToArray(); , everything works perfectly. When I return 100 objects, I get an exception:

enter image description here


What I did to solve the problem:

  • I am increasing the numbers in the configuration file to 2147483647
  • Instead of returning a list of objects, I serialized the list to myself in the service, and then created a Test method that would return a byte [] instead of a list. Then on the client, I deserialize the byte [] into a list, and it works! So I have a solution to the worst case scenario so far that I have to serialize my serlf object and deserialize it.

I would also like to take the opportunity to ask if I should use another binding. I heard that shared memory is posts, but I don't know how to use it in wcf. Since I communicate between one machine, I use named pipes.

+4
source share
1 answer

It seems like a serialization issue, try increasing the dataContractSerializer maxItemsInObjectGraph through the behavior in endpointBehaviors and serviceBehaviors.

Same problem here

+5
source

All Articles