Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6669223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:07:29+00:00 2026-05-26T03:07:29+00:00

I know this question has been asked many times on here but I have

  • 0

I know this question has been asked many times on here but I have gone through each of these and can’t seem to get it to work for me. From my client, I am trying to pass in 2 byte parameters and return byte[] but while it works fine when the parameters are small, it throws the “WCF service The maximum array length quota (16384) has been exceeded”.

Here is my Client web.config:

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_GenerateDocument" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="Transport">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
        <binding name="BasicHttpBinding_IGenerateDocument" 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="Text" 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://localhost:6543/GenerateDocument.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_GenerateDocument"
        contract="NWIS.DocumentGeneratorService.IGenerateDocument" name="NWIS.DocumentGeneratorService.GenerateDocument.svc" />
      <endpoint address="http://localhost:6543/GenerateDocument.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IGenerateDocument"
        contract="DocGenService.IGenerateDocument" name="BasicHttpBinding_IGenerateDocument" />
    </client>
  </system.serviceModel>

and here is the Server equivalent:

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_GenerateDocument" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="5242880" maxArrayLength="2147483646" 
                        maxBytesPerRead="4096" maxNameTableCharCount="5242880"/>
          <security mode="Transport">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehaviour">
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="false" />    
    <services>
      <service name="NWIS.DocumentGeneratorService.GenerateDocument" behaviorConfiguration="ServiceBehaviour">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:6543/"/>
          </baseAddresses>
        </host>
        <endpoint address="http://localhost:6543/GenerateDocument.svc" binding="basicHttpBinding" 
                  contract="NWIS.DocumentGeneratorService.IGenerateDocument"  />
      </service>
    </services>
  </system.serviceModel>

If anyone could see the reason that this works for say 400 bytes but does not for say 20000 bytes, I would be grateful for any guidance.

Thanking you all in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:07:30+00:00Added an answer on May 26, 2026 at 3:07 am

    You have defined your binding configuration on the server side with the extra large values – but you’re not using it!

    You need to specify in your service endpoint what binding configuration to use!

    So change your current config to:

    <service name="NWIS.DocumentGeneratorService.GenerateDocument" behaviorConfiguration="ServiceBehaviour">
        ....
        <endpoint 
            address="http://localhost:6543/GenerateDocument.svc" 
            binding="basicHttpBinding" 
            bindingConfiguration="BasicHttpBinding_GenerateDocument"  <== add this line here!!
            contract="NWIS.DocumentGeneratorService.IGenerateDocument"  />
    </service>
    

    and then, hopefully, your service will actually use those values you’ve configured!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this question has been asked many times, but I have not been
I know this question has probably been asked so many times here, but I
I know this question has been asked many times, but here are my specific
I know this question has been asked many and many times, but I have
I know this is a question that has been asked many times before, but
I know this question has been asked many times, but my problem is a
I know this question has been asked many times, but I am having trouble
I know this question has been asked many times, but I never saw a
I know this question has been asked many times and we have gotten this
I know this question has been asked many times. But from what I read,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.