【发布时间】:2011-03-17 18:06:33
【问题描述】:
我有一个 WCF Web 服务,它接受一些自定义对象和一些作为字节数组发送的文档。
但是每次我发送一个文档(不是特别大的文档)时,WS 都会返回一个 400 错误请求,并且在跟踪日志中它似乎抛出了一个 MaxReceivedMessageSizeExceeded。
说
System.ServiceModel.ProtocolException: 最大邮件大小配额 传入消息 (65536) 已 超过。要增加配额,请使用 MaxReceivedMessageSize 属性 适当的绑定元素。
现在客户端应用在其app.config 中有这个
<wsHttpBinding>
<binding name="WSHttpBinding_IReferrals"
closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32"
maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
在 WCF web.config 我有这个
<service behaviorConfiguration="WCFReferrals.Service1Behavior"
name="WCFReferrals.Referrals">
<endpoint address="" binding="wsHttpBinding" contract="WCFReferrals.IReferrals">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="wsHttpBinding" contract="IMetadataExchange" />
</service>
....
<binding name="wsHttpBinding" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
</binding>
据我所知,显然我遗漏了一些东西
任何帮助都会很乐意接受
谢谢
自然
【问题讨论】: