【发布时间】:2016-03-24 15:32:40
【问题描述】:
我正在向 WCF 服务发送一个数组,当数组超过大约 2400 个项目时,我收到一个协议错误。我试图通过修改服务的 web.config 文件来增加服务接受的大小,但没有任何成功。以下是 web.config 中的相关代码:
<system.web>
<httpRuntime maxRequestLength="2097151" />
<compilation debug="true" targetFramework="4.5"/>
<pages controlRenderingCompatibilityVersion="4.0"/>
</system.web>
<system.serviceModel>
<services>
<service name="prop84r4Service.ServiceProp84r4" behaviorConfiguration="ServiceBehavior">
<endpoint address="" binding="webHttpBinding" contract="prop84r4Service.IServiceProp84r4" behaviorConfiguration="web" bindingConfiguration="webHttpBindingDev">
</endpoint>
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="webHttpBindingDev">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</webHttpBinding>
</bindings>
<behaviors>
任何想法我做错了什么或没有做什么?
谢谢
【问题讨论】:
-
可能是 maxItemsInObjectGraph。见stackoverflow.com/questions/9191167/…
-
此链接上的 maxrecievedmessagesize 答案解决了问题——谢谢!