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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:08:48+00:00 2026-06-04T05:08:48+00:00

I am getting the following error: The maximum message size quota for incoming messages

  • 0

I am getting the following error:

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.
  1. I am using WebhttpBinding which uses REST service.
  2. There is no configuration setting from client side.
  3. I am using MVC3 application.

Need help in stream more than 65536 bytes.

Is there any way to edit the ServiceHostFactory behaviour so that somewhere I can set MaxReceivedMessageSize property to 2GB


thanks for your response.

Since I am using WebHttpBinding,I would like to know how to override the ServiceHostFactory .

Creating a custom class and overriding the OnOpening() method of WebServiceHost can resolve the problem or not?

  • 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-04T05:08:49+00:00Added an answer on June 4, 2026 at 5:08 am

    MaxReceivedMessageSize is a property of the binding element; if you need to change it from the defaults you have two options:

    1. Use a configuration file, and set it from within a binding element.
    2. Create the bindings in code and set the property there.

    To do this on the client side, without a configuration file, you’ll need to bypass the normal service reference code and create the client channel yourself. You can see an example of how to do this on my blog post about using WCF without the auto-generated client proxy: Proxy-Free WCF. In essence, you do something like this in code:

    var binding = new WebHttpBinding();
    binding.MaxReceivedMessageSize = int.MaxValue;
    
    var factory = new ChannelFactory<IServiceInterfaceChannel>(binding);
    var client = factory.CreateChannel(new Endpoint(SERVICE_URL));
    

    If you need to change the behavior on the service side, you can specify a binding by calling AddServiceEndpoint on the service host class, for example:

    var host = new WebServiceHost();
    var binding = new WebHttpBinding();
    binding.MaxReceivedMessageSize = int.MaxValue;
    
    host.AddServiceEndpoint(typeof(IServiceInterface), binding, SERVICE_URL);
    

    Also, I think that you could accomplish this by overriding the OnOpening method of a custom web service host, as per your question. Be aware that the base OnOpening behavior potentially creates endpoints and edits binding behavior, so you will want to let it do all of that first, before you try to change the binding configurations yourself. But I’m not really sure why you would go to all that trouble…

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

Sidebar

Related Questions

I'm getting the following error: RangeError: Maximum call stack size exceeded. on this row:
Am getting following error message on calling WCF service: The formatter threw an exception
I am getting following error message when using Doctrine ORM in Codeigniter. ( !
I'm getting the following error message: Warning: file_get_contents( http://localhost/sample_pie.php ) [function.file-get-contents]: failed to open
Getting following error message when I try to fetch JSON response into my app.
I am getting following error when I am trying to use Convert.FromBase64String The input
I am getting following error while exporting data to excel sheet ERROR: Message :
We are getting following error message in one Windows XP - X86 Exception Source:
I am getting following error for log4Net in Asp.Net 2.0 website. Compiler Error Message:
I am getting following error message all of the sudden. 5 minuted before everything

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.