【发布时间】:2012-08-08 04:58:06
【问题描述】:
如果有人能帮我弄清楚为什么在调用我的 WCF 服务时出现以下错误,我将永远感激不尽。
传入邮件的最大邮件大小配额 (65536) 已达到 超过。要增加配额,请使用 MaxReceivedMessageSize 相应绑定元素上的属性。
我已经尝试修改服务和客户端上的配置文件,并确保服务名称包含命名空间。我似乎无法取得任何进展。
这是我的服务配置设置:
<services>
<service name="CCC.CA-CP & Sightlines Campus Carbon Calculator">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="Binding2" contract="CCC.ICCCService" behaviorConfiguration="WebBehavior2" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="Binding2" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647"
maxBufferPoolSize="52428800" maxReceivedMessageSize="2147483647" messageEncoding="Text"
textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="16384"
maxBytesPerRead="20000" maxNameTableCharCount="16384" ></readerQuotas>
</binding>
</basicHttpBinding>
</bindings>
..
<dataContractSerializer maxItemsInObjectGraph="12097151" />
...
<requestLimits maxAllowedContentLength="157286400" />
...
<httpRuntime useFullyQualifiedRedirectUrl="true" maxRequestLength="2147483647"...
我还使用相同的绑定值设置客户端配置。
这是服务合同:
namespace CCC
{
[ServiceContract(Name = "CA-CP & Sightlines Campus Carbon Calculator", Namespace = "http://www.sightlines.com/CCC/01")]
public interface ICCCService
{
....
}
提前感谢您提供的任何帮助!
【问题讨论】:
-
您需要在客户端和服务器端更改 readerQuotas 和其他设置
标签: c# wcf wcf-binding