【问题标题】:Inserting large amount of data through wcf REST通过 wcf REST 插入大量数据
【发布时间】:2011-10-09 09:15:04
【问题描述】:

我有一个 ASP.NET Web 应用程序,我在其中使用 WCF 4 REST 服务插入和从数据库中获取数据。但是,当尝试插入大量数据(例如 1000 名员工的数据)时,我收到错误“文件意外结束”。

任何人都可以提出解决方案。提前致谢。

【问题讨论】:

标签: asp.net wcf-rest


【解决方案1】:

您是否尝试过在 WCF 服务的 web.config 中设置最大大小,也可能在客户端的 App/Web 配置文件中设置。它需要看起来像这样:

<binding name="NewBinding0" sendTimeout="00:10:00" maxBufferPoolSize="2147483647"
 maxReceivedMessageSize="2147483647">
 <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
  maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>

【讨论】:

    【解决方案2】:

    这应该适用于 REST 服务。

    <standardEndpoints>
      <webHttpEndpoint>
        <standardEndpoint helpEnabled="true" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
                          maxBufferPoolSize="2147483647" automaticFormatSelectionEnabled="true">
          <security mode="None"/>
        </standardEndpoint>
      </webHttpEndpoint>
    </standardEndpoints>
    

    【讨论】:

      猜你喜欢
      • 2012-04-29
      • 1970-01-01
      • 1970-01-01
      • 2016-12-22
      • 2011-09-22
      • 1970-01-01
      • 2021-12-24
      • 2012-06-10
      • 2011-10-12
      相关资源
      最近更新 更多