底层连接已关闭:连接意外关闭 - wcf [英] The underlying connection was closed: The connection was closed unexpectedly - wcf

查看:80
本文介绍了底层连接已关闭:连接意外关闭 - wcf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在WPF项目中使用WCF服务。我有大量数据,表中有大约847000条记录。客户端抛出此异常



I am using WCF Services in my WPF project. I have a large amount of data, about 847000 records in table. this exception is throwed on client side

proxy.ServicesClient client = new proxy.ServicesClient();
var result = client.GetCustomers(); // here throws ('ComunicationException was unhandled by user code: The underlying connection was closed: The connection was closed unexpectedly.')





在我的app.config中



In my app.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
      <bindings>
        <basicHttpBinding>
          <binding name="BasicHttpBinding_IServices" closeTimeout="00:10:00"

              openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"

              maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
            <security mode="None" />
          </binding>
        </basicHttpBinding>
      </bindings>
        <client>
            <endpoint address="http://localhost:5302/WpfStoreService.svc"

                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IServices"

                contract="proxy.IServices" name="BasicHttpBinding_IServices" />
        </client>
    </system.serviceModel>
</configuration>





在Web.Config



In Web.Config

<?xml version="1.0"?>
<configuration>

  <connectionStrings>
    <add name="AdventureWorksLTConnectionString" connectionString="Data Source=.;Initial Catalog=AdventureWorksLT;Integrated Security=True" />
  </connectionStrings>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>

    <bindings>
      <basicHttpBinding>

        <binding name="BasicHttpBinding_IServices" receiveTimeout="00:10:00" sendTimeout="00:10:00" openTimeout="00:10:00" closeTimeout="00:10:00"

                 maxReceivedMessageSize="2147483647"

                 maxBufferSize="2147483647"

                 maxBufferPoolSize="52428899">
          <readerQuotas maxDepth="128"

                        maxStringContentLength="2147483647"

                        maxArrayLength="2147483647"

                        maxBytesPerRead="4096"

                        maxNameTableCharCount="2147483647" />
          <security mode="None"/>
        </binding>
      </basicHttpBinding>
    </bindings>

    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="True" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>

    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>





你有没有在WCF服务上有这个问题?



Did you have this problem on WCF Services?

推荐答案

是的我有这个问题,但没有解决方案....?
yes i have this problem but didnt have solution....?


这篇关于底层连接已关闭:连接意外关闭 - wcf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆