tags:

views:

37

answers:

2

I have a WCF Service that has these configuration settings. When I call it from a client application I still hit the dreaded, "Maximum number of items that can be serialized or deserialized in an object graph is '65536'" What's wrong with my configuration below?

<system.serviceModel>
  <bindings>
   <wsHttpBinding>
    <binding name="LargeBuffer" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647">
     <readerQuotas maxDepth="2147483647" maxArrayLength="2147483647" maxStringContentLength="2147483647" 
          maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
    </binding>
   </wsHttpBinding>
  </bindings>
  <services>
   <service behaviorConfiguration="ServiceBehavior" name="TestWcfService.Service1">
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="LargeBuffer" name="ServiceEndPoint"
      contract="TestWcfService.IService1">
      <identity>
       <dns value="localhost" />
      </identity>
    </endpoint>
   </service>
  </services>
  <behaviors>
   <serviceBehaviors>
    <behavior name="ServiceBehavior">
     <serviceMetadata httpGetEnabled="true" />
     <dataContractSerializer maxItemsInObjectGraph="2147483647" />
     <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
   </serviceBehaviors>
  </behaviors>
 </system.serviceModel>
A: 

Yes I increased it on the client side to match. And it still hits that limit. My concern is that when it pulls the service reference back, it still sees 65536 as the default size so it never recognizes the larger amount. Any thoughts?

John
A: 

Here's my client side code:

<system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="ServiceEndPoint" closeTimeout="00:01:00" openTimeout="00:01:00"
                    receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
                    transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
                        maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="Message">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm=""/>
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            algorithmSuite="Default" establishSecurityContext="true" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:61423/Service1.svc" binding="wsHttpBinding"
                bindingConfiguration="ServiceEndPoint" contract="LucasImport.IService1"
                name="ServiceEndPoint">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>
John