首页 新闻 会员 周边

ProtocolException:已超过传入消息(65536)的最大消息大小配额

0
悬赏园豆:100 [已关闭问题] 关闭于 2012-03-11 10:45

SilverLight调用WCF,提交的是一个List<Linq2SqlEntity>;当List中数据量不大的时候,不会报错;当数据量稍微大一点儿,就会出现这个错误。发生了 System.ServiceModel.ProtocolException
  Message=已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。
  Source=System.ServiceModel
  StackTrace:
  在 System.ServiceModel.Channels.HttpInput.ThrowHttpProtocolException(String message, HttpStatusCode statusCode, String statusDescription)

费了牛劲在网上搜了一通,试了各种方法都没有搞定。
现在的配置文件:

<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="MessageHeaderOperationBehaviourAuthenticationBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
<services>
<service behaviorConfiguration="MessageHeaderOperationBehaviourAuthenticationBehavior"
name
="MessageHeaderOperationBehaviourAuthentication">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="LargeSize" contract="DyeService">
</endpoint>
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="LargeSize" maxBufferSize="2147483647"
maxBufferPoolSize
="21474836471" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength
="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount
="2147483647" />
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>


已经设置了maxReceivedMessageSize, 已经把endpoint与自定义binding关联起来了,还是不给力。

求解。

Silent Void的主页 Silent Void | 初学一级 | 园豆:107
提问于:2011-07-02 20:34
< >
分享
所有回答(2)
0

这个客户端跟服务器端的配置文件都要改为一致才行的

artwl | 园豆:16736 (专家六级) | 2011-07-03 10:40
0

在服务器端修改后,客户端重新自动生成就可以了.

LoveJenny | 园豆:532 (小虾三级) | 2011-07-04 06:33
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册