【问题标题】:Max length of array sent to WCF service发送到 WCF 服务的数组的最大长度
【发布时间】: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>

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

谢谢

【问题讨论】:

标签: c# wcf


【解决方案1】:

绑定上的 maxrecievedmessage 大小参数解决了我位于此链接的问题:

WCF - How to Increase Message Size Quota

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-15
    • 2012-06-22
    相关资源
    最近更新 更多