我有一个使用控制台应用程序连接到的休息 WCF 服务。控制台应用程序下载文件。小文件工作正常。对于较大的文件,我收到以下错误:
The maximum message size quota for incoming messages (65536) has been exceeded.
To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element
这是我在客户端控制台应用程序上的配置文件。
<configuration>
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding maxReceivedMessageSize="2000000"
maxBufferSize="2000000">
<readerQuotas maxStringContentLength="2000000"/>
</binding>
</webHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
WCF 配置如下:
<webHttpBinding>
<binding name="MyTestBinding" maxReceivedMessageSize="10000000" maxBufferPoolSize="10000000" maxBufferSize="10000000" transferMode="Buffered">
<readerQuotas maxDepth="10000000" maxArrayLength="10000000" maxBytesPerRead="10000000" maxNameTableCharCount="10000000" maxStringContentLength="10000000" />
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</webHttpBinding>
我正在使用 WebChannelFactory 连接到服务。有什么问题?