【发布时间】:2015-09-10 07:23:13
【问题描述】:
我有一个 WCF 服务,我试图在其中提取某个 XML 文件,并将该文件发送到客户端,但我不断收到此错误:
已超出传入邮件的最大邮件大小配额 (65536)。要增加配额,请在适当的绑定元素上使用 MaxReceivedMessageSize 属性。
我在 app.config 中更改了 maxReceivedMessageSize。
App.config
端点配置
<services>
<service name="MobileReportService.Service" behaviorConfiguration="ServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/Design_Time_Addresses/MobileReportService/Service/" />
</baseAddresses>
</host>
<endpoint name="ServiceEndpoint"
binding="basicHttpBinding"
contract="MobileReportService.IService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
绑定配置
<bindings>
<basicHttpBinding>
<binding maxBufferPoolSize="5242880" maxBufferSize="5242880"
maxReceivedMessageSize="5242880" />
</basicHttpBinding>
</bindings>
我不太明白为什么maxReceivedMessageSize 无法读取?
编辑
我正在通过每次运行服务时出现的弹出窗口测试服务,方法是按“调用”
【问题讨论】:
标签: wcf exception maxreceivedmessagesize