发送到WCF服务的最大数组长度

时间:2016-03-24 15:32:40

标签: c# wcf

我将一个阵列发送到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>

任何想法我做错了什么或不做?

由于

1 个答案:

答案 0 :(得分:0)

绑定上的maxrecievedmessage size参数解决了我在此链接中遇到的问题:

WCF - How to Increase Message Size Quota

相关问题