troubleshooting Question

How important are the readerQuotas settings in a SVCUtil generated WCF proxy class when on the Client side of a WCF service?

Avatar of mcbridedm
mcbridedm asked on
WCF
2 Comments1 Solution954 ViewsLast Modified:
I'm unable to use the .config file as I'm working on a DLL and do not have access to the main apps .config to copy my content into.  To get around this, I'm manually building up the BasicHttpBinding object using the same settings specified in the app.config that was generated with SVCUtil and using this binding to create my client object of type proxy class.

Some of the webservice calls are posting files to the service and receiving back files of roughly the same size but in a different format.  All is working great except when trying to receive files above the size of 16384 bytes which appears to match consistently with the readerQuotas maxArrayLength.

How important is it that these settings remain consistent with what was originally generated from the service itself using svcutil?  Are the readerQuota settings client side specific, in which case I can set whatever I like?

<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IServiceProvider" closeTimeout="00:01:00"
            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
            allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
            maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
            messageEncoding="Mtom" textEncoding="utf-8" transferMode="Buffered"
            useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
                realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://test.com:10002/Service/Service.svc"
          binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IServiceProvider"
          contract="IServiceProvider" name="BasicHttpBinding_IServiceProvider" />
    </client>
  </system.serviceModel>
</configuration>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros