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 7627253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:26:05+00:00 2026-05-31T05:26:05+00:00

I have a WCF service method I’ve implemented that gets passed an IEnumerable [OperationContract]

  • 0

I have a WCF service method I’ve implemented that gets passed an IEnumerable

    [OperationContract]
    List<Item> GetItems(DateTime sinceDate, IEnumerable<Guid> idList);

The method works as intended when passing in an IEnumerable of size 1000 or fewer; the service returns with an expected response. At some point, the array passed in is too large (seen at 2000 items) and a System.ServiceModel.ProtocolException is thrown, "{"The remote server returned an unexpected response: (400) Bad Request."}"

I’m not sure what’s governing the array size limitation. I’m aware of the readerQuotas section of a binding, and the maxArrayLength is set to the default 16384. My buffer sizes are set large enough, but I’m not sure why the service call is failing. Is there a limitation on the basicHttpBinding for array sizes passed in? What needs to change in my configuration so that I can pass in large arrays?

Here is my app.config in the client side. Server side is equivilant.

<binding name="BasicHttpBinding_IMyService" closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
      allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
      maxBufferSize="20000000" maxBufferPoolSize="524288" maxReceivedMessageSize="20000000"
      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>
  • 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-31T05:26:06+00:00Added an answer on May 31, 2026 at 5:26 am

    You need to register a service behavior that increase the max object items in graph:

    <serviceBehaviors>
        <behavior name="IncreadedSizeBehavior">
          <dataContractSerializer maxItemsInObjectGraph="100000"/>
        </behavior>
      </serviceBehaviors>
    

    You then need to register this behavior in your endpoint:

    <services>
        <service name="MyService" behaviorConfiguration="IncreadedSizeBehavior">
            <host />
            <endpoint />
    </services>
    

    The thing that is most helpful when debugging wcf issues is enabled trace error logging:

    <system.diagnostics>
            <trace autoflush="true" />
            <sources>
                <source name="System.ServiceModel"
                                switchValue="Error"
                                propagateActivity="true">
                    <listeners>
                        <add name="sdt"
                                type="System.Diagnostics.XmlWriterTraceListener"
                                initializeData= "ErrorTrace.svclog"
                                />
                    </listeners>
                </source>
            </sources>
        </system.diagnostics>
    

    Then opening that trace file with the svc trace viewer, downloadable with the windows sdk. You get a nice view of all the errors and what the actual error was when the message was being processed.

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

Sidebar

Related Questions

I have a WCF service method that accepts a List of objects. For this
I have a WCF service method that expects an object and then retrieves its
I have a WCF service method that's running in a worker thread I spin
I have a WCF Service that exposes a method GetCustomers(). The internals of the
I have a basicHttpBinding WCF service. Via the contract I expose a method that
Hi I want to create a WCF service that have login method, which is
I have a WCF service method that returns a big byte[] array around 2
I have an ajax enabled WCF service method : [OperationContract] public string Test(string name)
I have a WCF service with one method: [OperationContract] bool VerifyLicense(string clientId, string license);
I have a WCF service method that I want to perform some action asynchronously

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.