标签:arch int height tab lex hostname car asm 方法
转自海乐学习原文WebService出错 Maximum message size quota for incoming messages (65536) has been exceeded.已超过传入消息(65536)的最大消息大小配额
问题1:WebService出错 Maximum message size quota for incoming messages (65536) has been exceeded.
今天下午在网上一直搜索解决方案将近2个小时,人要崩溃了,除了StackOverflow上的洋文有些信息外,国内几乎不见踪影。十分苦恼,英语看起来十分费劲,也没有给出直接的解决方案。后来在看到了海乐学习的一篇文章,先将其整理过来,以飨读者。
问题的根本原因正如错误异常说明的那样,起始方法上面也说了,只是对于新人来说,你根本不知道在哪里进行设置。其实就是在app.config中的下面,设置一下请求的一些参数的数值。

这样一来,就摆脱了默认参数的请求大小的设置,而可以请求较大的包了。设置的方框中的内容在下面的代码段中,你们拷贝一下就好了(注意只拷贝方框中的内容,同时注意修改椭圆中的值,使得其前后一致)。
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ServerUpdaterSoap" 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" maxReceivedMessageSize="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>
<client>
<endpoint address="http://localhost:3604/ServerUpdater.asmx"
binding="basicHttpBinding" bindingConfiguration="ServerUpdaterSoap"
contract="WebReferenceUpdater.ServerUpdaterSoap" name="ServerUpdaterSoap" />
</client>
</system.serviceModel>
</configuration>
2:读取 XML 数据时,超出最大字符串内容长度配额 (8192)。通过更改在创建 XML 读取器时所使用的 XmlDictionaryReaderQuotas 对象的 MaxStringContentLength 属性,可增加此配额。 第 211 行,位置为 394。
解决办法:
也是修改Web.Config中的MaxStringContentLength ,这是有些数据比较长的时候出现这个问题,改大一点就可以了吧。
<readerQuotas maxDepth="64" maxStringContentLength="8192000" maxArrayLength="16384000"
maxBytesPerRead="4096000" maxNameTableCharCount="16384000" />
标签:arch int height tab lex hostname car asm 方法
原文地址:http://www.cnblogs.com/arxive/p/6413414.html