我有一个WCF服务。我运行客户端应用程序时收到以下消息WCF:如何设置MaxReceivedMessageSize配额
传入消息(65536)的最大消息大小配额已超过 。要增加配额,请在适当的绑定元素上使用MaxReceivedMessageSize 属性。
另外我在客户端和服务器项目的相关配置中添加了MaxReceivedMessageSize属性。
我的客户端应用程序配置为:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="RPBasicHttpBinding" allowCookies="true" maxReceivedMessageSize="20000000" maxBufferSize="20000000" maxBufferPoolSize="20000000">
<readerQuotas maxDepth="32" maxArrayLength="200000000" maxStringContentLength="200000000"/>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:40003/PersonWcfService.svc/PersonServices"
binding="basicHttpBinding"
contract="RP.Common.ServiceContract.IPersonService" name="BasicHttpBinding_IPersonService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
我在WCF项目配置为:
<system.serviceModel>
<services>
<service name="RP.WcfService.PersonWcfService" behaviorConfiguration="RP.WcfServiceBehaviour">
<endpoint address="PersonServices" binding="basicHttpBinding" bindingConfiguration="RPBasicHttpEndpointBinding" contract="RP.Common.ServiceContract.IPersonService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="RP.WcfServiceBehaviour">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="RPBasicHttpEndpointBinding" allowCookies="true" maxReceivedMessageSize="20000000" maxBufferSize="20000000" maxBufferPoolSize="20000000">
<readerQuotas maxDepth="32" maxArrayLength="200000000" maxStringContentLength="200000000"/>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
其他地方,然后我应该设置MaxReceivedMessageSize属性增加邮件大小配额?
+1没有看到,可能是这个问题 –
+1谢谢!我的问题通过在端点配置中添加'bindingConfiguration =“RCISPBasicHttpBinding”'解决。 – Ehsan