An error occurs when the message received by a WebService application is very large.
1: Maximum Message Size quota for incoming messages (65536) has been exceeded.The maximum Message Size quota of the incoming message (65536) has been exceeded. To increase the quota, use the maxcompute edmessagesize attribute on the corresponding binding element.
Note:An error occurred while executing the current Web request. Check the stack trace information to learn about this error andCodeDetailed information about the cause of the error.
Exception details:System. servicemodel. quotaexceededexception: The maximum Message Size quota for incoming messages (65536) has been exceeded. To increase the quota, use the maxcompute edmessagesize attribute on the corresponding binding element.
Solution:
Modify the Web. config file. The maxcompute edmessagesize can be increased to 2147483647.
Maxbuffersize = "2147483647" maxbufferpoolsize = "524288" maxcompute edmessagesize = "2147483647"
2:When reading XML data, the maximum length of string content exceeds the limit (8192 ). You can add this quota by changing the maxstringcontentlength attribute of the xmldictionaryreaderquotas object used when creating an XML reader. 211st rows at 394.
Solution:
You can also modify the maxstringcontentlength in Web. config. This problem occurs when some data is relatively long. You can change it to a larger value.
<Readerquotas maxdepth = "64" maxstringcontentlength = "8192000" maxarraylength = "16384000"
Maxbytesperread = "4096000" maxnametablecharcount = "16384000"/>
The complete code is as follows:
<System. servicemodel>
<Bindings>
<Basichttpbinding>
<Binding name = "fileservicesoapbinding" closetimeout = "00:01:00"
Opentimeout = "00:01:00" receivetimeout = "00:10:00" sendtimeout = "00:01:00"
Allowcookies = "false" bypassproxyonlocal = "false" hostnamecomparisonmode = "strongwildcard"
Maxbuffersize = "2147483647" maxbufferpoolsize = "524288" maxcompute edmessagesize = "2147483647"
Messageencoding = "text" textencoding = "UTF-8" transfermode = "buffered"
Usedefaultwebproxy = "true">
<Readerquotas maxdepth = "64" maxstringcontentlength = "8192000" maxarraylength = "16384000"
Maxbytesperread = "4096000" maxnametablecharcount = "16384000"/>
<Security mode = "NONE">
<Transport clientcredentialtype = "NONE" proxycredentialtype = "NONE"
Realm = ""/>
<Message clientcredentialtype = "username" algorithmsuite = "default"/>
</Security>
</Binding>
<Binding name = "fileservicesoapbinding1" closetimeout = "00:01:00"
Opentimeout = "00:01:00" receivetimeout = "00:10:00" sendtimeout = "00:01:00"
Allowcookies = "false" bypassproxyonlocal = "false" hostnamecomparisonmode = "strongwildcard"
Maxbuffersize = "2147483647" maxbufferpoolsize = "524288" maxcompute edmessagesize = "2147483647"
Messageencoding = "text" textencoding = "UTF-8" transfermode = "buffered"
Usedefaultwebproxy = "true">
<Readerquotas maxdepth = "64" maxstringcontentlength = "8192000" maxarraylength = "16384000"
Maxbytesperread = "4096000" maxnametablecharcount = "16384000"/>
<Security mode = "NONE">
<Transport clientcredentialtype = "NONE" proxycredentialtype = "NONE"
Realm = ""/>
<Message clientcredentialtype = "username" algorithmsuite = "default"/>
</Security>
</Binding>
</Basichttpbinding>
</Bindings>