WCF 4剩余最大接收邮件大小
我正在测试一个WCF4REST接口 当尝试使用fiddler进行get时,我收到以下消息: 已超过传入邮件(65536)的最大邮件大小配额。若要增加配额,请在相应的绑定元素上使用MaxReceivedMessageSize属性 我试图在我的web.config文件中增加它,但没有成功:WCF 4剩余最大接收邮件大小,wcf,rest,Wcf,Rest,我正在测试一个WCF4REST接口 当尝试使用fiddler进行get时,我收到以下消息: 已超过传入邮件(65536)的最大邮件大小配额。若要增加配额,请在相应的绑定元素上使用MaxReceivedMessageSize属性 我试图在我的web.config文件中增加它,但没有成功: <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> <stand
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<standardEndpoints>
<webHttpEndpoint>
<!--
Configure the WCF REST service base address via the global.asax.cs file and the default endpoint
via the attributes on the <standardEndpoint> element below
-->
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true" maxReceivedMessageSize="327680" />
</webHttpEndpoint>
</standardEndpoints>
谢谢,
Mikkel使用ActivityTracing在详细级别捕获WCF跟踪,并在Construction ServiceHost和Open ServiceHost activity下检查在您的服务上应用了哪些ENPOINT。这将使您了解上述配置是否应用于服务 嗯,,
Amit您是否在web.config(服务端)和客户端配置(文件)中都增加了MaxReceivedMessageSize值
如果是这样的话,您是否可以尝试将MaxBufferSize增加到与MaxReceivedMessageSize相同的值?我今天刚刚遇到了这个问题,弄明白它有点痛苦。以下配置(根据答案改编)应能正常工作:
<system.web>
<!-- maxRequestLength is in KB -->
<httpRuntime maxRequestLength="320" />
</system.web>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<bindings>
<webHttpBinding>
<binding maxReceivedMessageSize="327680" />
</webHttpBinding>
</bindings>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name=""
helpEnabled="true"
automaticFormatSelectionEnabled="true" />
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
我很确定您需要
httpRuntime
位,因为您在运行时将aspNetCompatibilityEnabled设置为true。请通过以下web配置(服务中)设置进行尝试:
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true"
crossDomainScriptAccessEnabled="true"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
maxBufferPoolSize="4194304" />
</webHttpEndpoint>
</standardEndpoints>
<bindings>
<webHttpBinding>
<binding>
<readerQuotas maxStringContentLength="2147483647"/>
</binding>
</webHttpBinding>
</bindings>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
您确定您的邮件一定很长吗?您的问题可能存在(甚至比新的最大值还要大)。在som场景中需要获取大量数据。我已将配置更改为“”。我正在从fiddler 2进行测试,我不知道如何使用fiddler设置客户端配置。