Wednesday, September 09, 2009 #

Big Huge Objects and WCF

I had to send a big object across the wire- An collection containing 31,000 objects each with their own complex object graph (don't ask) and I was really running into problems with WCF crapping out on the call.

I did all the obvious stuff to the server web.config...

                 maxBufferSize="2147483647"
                 maxReceivedMessageSize="2147483647" 
                 maxItemsInObjectGraph="2147483647" 

But it still wasn't working.
Luckily I had a few awesome friends come to my rescue: D'Arcy Lussier and Jason Klassen sent me the following- I am posting it here for others. (And so I can find this again later).

server web.config  needed

 

 <serviceBehaviors>

        <behavior name="CustomerBehavior">

          <serviceMetadata httpGetEnabled="true" />

          <serviceDebug includeExceptionDetailInFaults="false" />

          <dataContractSerializer maxItemsInObjectGraph="2147483647" />

        </behavior>

</serviceBehaviors>

 

 

client web.config  needed

 

<behaviors>

      <endpointBehaviors>

        <behavior name="LargeDataBehavior">

          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>   

        </behavior>

      </endpointBehaviors>

</behaviors>

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Wednesday, September 09, 2009 1:58 PM | Feedback (10)

Copyright © Kirstin Juhl

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski