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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:32:47+00:00 2026-06-01T18:32:47+00:00

There are multiple related questions on SO (almost same title), none of them helped

  • 0

There are multiple related questions on SO (almost same title), none of them helped me to
fix my problem. Please do not close my question as duplicate before
reading it. Thanks.

I’m currently using WCF to expose a webservice (SOAP, HTTP). It is deployed in IIS Express for now. My problem is, I can’t manage to consume my service from my client. My client receives a HTTP Error 400 Bad request exception.

I’ve then activated tracing on server side to see what’s actually happening, here’s what I get:

enter image description here

I’ve translated the error message into English: The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element..

Pretty self-explanatory, actually. As my SOAP message is quite heavy, it probably exceeds the limit of 64KB.

I decided to extends this limit in the binding configuration. So here’s my web.config (server side):

<services>
  <service name="MyServiceName">
    <endpoint binding="basicHttpBinding"
              bindingConfiguration="MyBindingConfiguration"
              bindingNamespace="http://my_namespace"
              contract="XXX.IMyContract" />
  </service>
</services>

<bindings>
  <basicHttpBinding>
    <binding name="MyBindingConfiguration"
             allowCookies="true"
             maxReceivedMessageSize="2147483647"
             maxBufferSize="2147483647"
             maxBufferPoolSize="2147483647">
      <readerQuotas maxDepth="32" maxArrayLength="2147483647" maxStringContentLength="2147483647" />
    </binding>
  </basicHttpBinding>
</bindings>

As you can see, all sizes are set to int.MaxValue.

I’ve also modified my client app.config, here it is:

<bindings>
  <basicHttpBinding>
    <binding name="MyBindingName"
             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="2147483647"
                    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:8083/myAddress.svc"
            binding="basicHttpBinding"
            bindingConfiguration="MyBindingName"
            contract="IMyContract"
            name="MyBindingName" />
</client>

I then redeployed my service, and the issue was still here (HTTP 400, Bad request on client side + MaxReceivedMessageSize limited to 65536 on server side).

I then tested my service with a very small SOAP message: everything is perfectly fine. So the problem is really that my message is bigger than 64KB.

I spent 2 hours yesterday trying to figure out what’s the problem with my configuration… Probably something obvious, but I can’t find…

I’ve googled a lot about this problem, 95% of time the issue is the developer forgot to specify the bindingConfiguration attribute in the service endpoint. As you can see in my web.config above, it’s OK for me.

Then I’ve found another question on stackoverflow about the (almost) same issue.

As the author said in his question, setting the name of the binding configuration to string.Empty “fixes” the problem:

<services>
  <service name="MyServiceName">
    <endpoint binding="basicHttpBinding"
              bindingConfiguration=""
...

<bindings>
  <basicHttpBinding>
    <binding name=""
...

When using the default binding, everything works fine. I can’t just fix my problem using this workaround because I need to specify multiple different binding configurations in the same web.config.

I’m recreating a question here because it’s not actually the same conditions: my service is not self-hosted but hosted in IIS Express (or IIS 7.5, tested, same problem).

I’ve found a similar issue here with a self-hosted service, and the issue was related to this particularity. So I think there is something different between those 2 SO questions.

I guess there’s something obviously wrong in my configuration, but I can’t find what.
Any help appreciated.

  • 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-06-01T18:32:48+00:00Added an answer on June 1, 2026 at 6:32 pm

    Everything seems to be fine at first glance – only point is: the <service name="....."> attribute must match exactly to your fully-qualified service implementation class (including all namespaces etc.) – is that the case??

    I ask because you have contract="XXX.IMyContract" indicating a namespace, but your <service name="...."> attribute doesn’t have any namespace hinted at.

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

Sidebar

Related Questions

I know there are multiple questions on here related to the same issue but
NOTE: There are other questions related to this on SO, but none of them
There are multiple overloads for sqlcommand.Parameters.Add(...) function. Some of them do not take size,
There are multiple related questions, but I'm looking for a solution specific to my
There are multiple related questions, but I'm looking for a solution specific to my
Although there are many related questions, I don't see one that addresses adding multiple
Say there are multiple requests in a integration test, some of them are local
Lets take StackOverflow questions as example. Each of them has multiple tags assigned. How
There are related questions, such as How can I pass in 2 parameters to
This question is related to (but perhaps not quite the same as): Does Django

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.