This article is a mirror article of machine translation, please click here to jump to the original article.

View: 18761|Reply: 1

[WCF/Web Servics] The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the ...

[Copy link]
Posted on 4/24/2017 5:02:30 PM | | |
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.


In using WCF, I encounter the following issues:


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.

Problem description:

When the client calls WCF and returns a large amount of data, there is no problem with the LAN (the customer found a problem with a machine on site, the specific reason is unknown. There is a problem with posting to the extranet.


The exception information that VS2012 Debug catches is: An error was occurring while transferring data over an HTTP channel (data could not be read from the transport connection: the connection was closed. )。

The exception returned by the WCFStorm tool is: 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.

Before the error, both the server and the client had added the following settings:


Add the following code on the server side to solve the problem:

I hope it can solve you who are experiencing the same problem.

Other solutions:

After reading @sunny007sun's post http://bbs.csdn.net/topics/360255080, a solution was found http://www.cnblogs.com/happyhippy/archive/2011/07/02/2096482.html his record (blog).
The web.config automatically generated by Silverlight does not have configuration information for services and needs to be added here
    <services>
      <service behaviorConfiguration="MyBehavior" name="WcfService1.Service1">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="NewBinding0"
          contract="WcfService1.IService1" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
In fact, there is still a difference between service.name and endpoint.contract, contract is a protocol, corresponding to the ServiceContract under the WCF project, that is, the interface IService1, and service corresponds to the specific call of svc, that is, Service1.

So far, the problem has been solved, thank you @sunny007sun for the 11 years of posting and blogging.





Previous:.NET/C# Huawei NB-IoT Interface Debugging Tool [Source Code]
Next:Winform ListView double-click right-click function
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com