2013-03-28 2 views
1

WPF 프로젝트에서 WCF 서비스를 사용하고 있습니다. 나는 많은 양의 데이터를 가지고 있는데, 약 847 000 레코드가 테이블에있다. 이 예외는 클라이언트 측에서 throwed되는 VM에서기본 연결이 닫혔습니다 : 예기치 않게 연결이 끊어졌습니다. wcf

의 App.config에서
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.') 

의 Web.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> 
     <behaviors> 
     <endpointBehaviors> 
      <behavior name="clientBehavior"> 
      <dataContractSerializer maxItemsInObjectGraph="2147483647" /> 
      </behavior> 
     </endpointBehaviors> 
     </behaviors> 
     <client> 
      <endpoint address="http://localhost:7902/WpfStoreService.svc" 
       binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IServices" 
       contract="proxy.IServices" name="BasicHttpBinding_IServices" behaviorConfiguration="clientBehavior" /> 
     </client> 
    </system.serviceModel> 
</configuration> 

<?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="2147483647"> 
      <readerQuotas maxDepth="2147483647" 
         maxStringContentLength="2147483647" 
         maxArrayLength="2147483647" 
         maxBytesPerRead="214748364" 
         maxNameTableCharCount="2147483647"/> 

      <security mode="None"/> 
     </binding> 

     </basicHttpBinding> 
    </bindings> 

    <services> 
     <service name="WpfStore.Services.Services" behaviorConfiguration="debugbehavior"> 
     <endpoint address="" binding="basicHttpBinding" contract="WpfStore.Services.Contracts.IServices" bindingConfiguration="BasicHttpBinding_IServices"/> 
     </service> 
    </services> 

    <behaviors> 
     <serviceBehaviors> 
     <behavior name="debugbehavior"> 
      <serviceMetadata httpGetEnabled="true"/> 
      <serviceDebug includeExceptionDetailInFaults="false"/> 
      <dataContractSerializer maxItemsInObjectGraph="2147483647"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
    </system.serviceModel> 
<system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 
</configuration> 

참고 : 1. 그것을 많은 양의 데이터로 작동하지 않습니다. 이 경우 테이블에 약 847 000 개의 레코드가 있습니다. 작은 데이터로 완벽하게 작동합니다 (약 5000 - 6000 개의 레코드로). 2. SQL 서버에서 검색된 모든 레코드가 내 DAL로 디버깅됩니다. 이 예외는 클라이언트에서이 서비스 기능을 호출 한 후 5-10 초 동안 발생합니다.

+4

전선을 통해 심각하게 847000 개의 레코드를 보내고 있습니까? 어쩌면 페이징을 고려해야합니까? – failedprogramming

+0

간단히 테스트했는데 7000 레코드도 작동하지 않았습니다 – user746499

+0

왜 추적하지 않습니까? http://stackoverflow.com/q/4271517/413032 이러한 유형의 문제는 대부분 추적을 통해 해결할 수 있습니다. 그것은 당신의 연결을 잃은 것 같습니다. –

답변

관련 문제