none
MaxReceivedMessageSize RRS feed

  • Question

  • I have a Silverlight application which is throwing an exception

    "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."

    I've tried adjusting a number of settings in web.config and also on the service side, but so far no luck. Is there something I can do to narrow down what setting I need? e.g. maxBufferSize="2147483647"


    Joe Garry

    Thursday, February 13, 2014 8:12 PM

Answers

  • Hello Joe,

    Can you post both the server and client config?  

    Also, at a high level describe the service.  Is it one that will receive a large message or return a large response.  Hopefully not one that will receive and send large!

    My hunch is the config you are editing is not the one that is being referenced (as this is something that I have done and seen others do).  To double check, make a change to the file that would cause the client to break (change security in the binding).


    Jeff

    Thursday, February 13, 2014 8:46 PM
  • Hi,

    >>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

    When occur the above error information, please try to do refer to do some setting about increase the maxReceivedMessageSize and timeout and so on:

    <binding name="basicHttpBinding_IMyService" 
             closeTimeout="00:20:00" 
             openTimeout="00:20:00" 
             receiveTimeout="00:20:00" 
             sendTimeout="00:20:00"
             maxBufferPoolSize="2147483647" 
             maxReceivedMessageSize="2147483647"
             maxBufferSize="2147483647">
      <readerQuotas maxDepth="32
             maxStringContentLength="2147483647"
             maxArrayLength="2147483647" 
             maxBytesPerRead="2147483647"
             maxNameTableCharCount="2147483647" />
    
    </binding>

    Then please try to not forget to apply these binding config to the endpoint:

    <endpoint address=" " 
              binding="basicHttpBinding"
              contract="YourServiceContract" 
              bindingConfiguration="basicHttpBinding_IMyService" />

    Also please try to check this blog:
    http://dotnet.dzone.com/news/wcf-maximum-message-size-quota .

    The similar threads:
    http://stackoverflow.com/questions/884235/wcf-how-to-increase-message-size-quota .

    http://stackoverflow.com/questions/19564047/wcf-the-maximum-message-size-quota-for-incoming-messages-65536-has-been-exceed .

    Best Regards,
    Amy Peng



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 14, 2014 8:33 AM
    Moderator

All replies

  • Hello Joe,

    Can you post both the server and client config?  

    Also, at a high level describe the service.  Is it one that will receive a large message or return a large response.  Hopefully not one that will receive and send large!

    My hunch is the config you are editing is not the one that is being referenced (as this is something that I have done and seen others do).  To double check, make a change to the file that would cause the client to break (change security in the binding).


    Jeff

    Thursday, February 13, 2014 8:46 PM
  • I can't publish the files. We have a customer who is transmitting a larger message then usual which is causing the problem.

    What I'm hoping is that there is some way I can narrow down what setting(s) is causing the problem.


    Joe Garry

    Thursday, February 13, 2014 9:27 PM
  • Ok.  It is most likely the setting on the service then.  From MSDN: http://msdn.microsoft.com/en-us/library/system.servicemodel.basichttpbinding.maxreceivedmessagesize(v=vs.100).aspx

    It is not always this simple though as the initial question is: is it ok for the customer to transmit a larger message?  If so, do you want everyone to be able to transmit this size of message?  You can set it to something crazy like 2GB...  What size is too big?  The intention of the setting is to protect the service from deliberate or accidentally attack.


    Jeff

    Friday, February 14, 2014 1:27 AM
  • Hi,

    >>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

    When occur the above error information, please try to do refer to do some setting about increase the maxReceivedMessageSize and timeout and so on:

    <binding name="basicHttpBinding_IMyService" 
             closeTimeout="00:20:00" 
             openTimeout="00:20:00" 
             receiveTimeout="00:20:00" 
             sendTimeout="00:20:00"
             maxBufferPoolSize="2147483647" 
             maxReceivedMessageSize="2147483647"
             maxBufferSize="2147483647">
      <readerQuotas maxDepth="32
             maxStringContentLength="2147483647"
             maxArrayLength="2147483647" 
             maxBytesPerRead="2147483647"
             maxNameTableCharCount="2147483647" />
    
    </binding>

    Then please try to not forget to apply these binding config to the endpoint:

    <endpoint address=" " 
              binding="basicHttpBinding"
              contract="YourServiceContract" 
              bindingConfiguration="basicHttpBinding_IMyService" />

    Also please try to check this blog:
    http://dotnet.dzone.com/news/wcf-maximum-message-size-quota .

    The similar threads:
    http://stackoverflow.com/questions/884235/wcf-how-to-increase-message-size-quota .

    http://stackoverflow.com/questions/19564047/wcf-the-maximum-message-size-quota-for-incoming-messages-65536-has-been-exceed .

    Best Regards,
    Amy Peng



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 14, 2014 8:33 AM
    Moderator
  • No answer has been supplied to this question. I have passed this on to another engineer who is still looking at it. The exception is overly specious and there is no known method to narrow down the setting that needs to be changed.

    Joe Garry

    Thursday, February 20, 2014 2:59 AM