title: WCF service dataContractSerializer maxItemsInObjectGraph in web.config
body: <p>I am having issues specifying the dataContractSerializer maxItemsInObjectGraph in host's web.config. </p>
  
  <pre><code> &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name="beSetting"&gt;
        &lt;serviceMetadata httpGetEnabled="True"/&gt;
        &lt;serviceDebug includeExceptionDetailInFaults="True" /&gt;
        &lt;dataContractSerializer maxItemsInObjectGraph="2147483646"/&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
  &lt;/behaviors&gt;
   &lt;services&gt;
    &lt;service name="MyNamespace.MyService"
             behaviorConfiguration="beSetting" &gt;
      &lt;endpoint address="http://localhost/myservice/"
                binding="webHttpBinding"
                bindingConfiguration="webHttpBinding1"
                contract="MyNamespace.IMyService"
                bindingNamespace="MyNamespace"&gt;
      &lt;/endpoint&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  </code></pre>
  
  <p>The above has no effect on my data pull. The server times out because of the large volume of data. </p>
  
  <p>I can however specify the max limit in code and that works</p>
  
  <pre><code>  [ServiceBehavior(MaxItemsInObjectGraph=2147483646, IncludeExceptionDetailInFaults = true)]
    public abstract class MyService : MyService 
    {
     blah...
   }
  </code></pre>
  
  <p>Does anyone know why I can't make this work through a web.config setting? I would like to keep in the web.config so it is easier for future updates. </p>