2011-01-29 2 views
2

바보 오류의 종류,하지만 서버 측 서비스 (WCF 양면)에 의해 클라이언트를 호출하고 싶어 할 때 이런 일이 :WCF 콜백 시간 제한 및 Visual Studio 치명적인 오류

메시지가 내 전송할 수 없습니다 00 : 01 : 00에 할당 된 wcf 콜백 시간 초과, 신뢰할 수있는 채널의 전송 창에 사용 가능한 공간이 없습니다.

또한 mysterious happened too입니다. 로그인 방법에서 사용자와 비밀번호가 틀린 경우 서비스를 호출하면 보낸 사람 - 콜백을 찾은 다음 발신자에서 GetError 메서드를 호출하여 "사용자가 잘못되었습니다"와 같은 논리적 오류를 표시합니다. 이것은 잘 작동하지만 사용자와 비밀번호가 정확하고 액세스 권한이있는 경우 다른 모든 클라이언트 측 메소드와 마찬가지로 오류가 발생합니다.이 모든 메소드에서 간단한 문자열보다 많은 데이터를 보내고 geterror를 보냈습니다!

편집 2 : 대부분의 콜백 메서드에서 말했듯이 데이터 컨텍스트 (LINQ to SQL) 데이터 클래스 (목록 또는 단일 행)와 같은 데이터를 보냈습니다. 그래서 이것이 내 문제인지 아닌지!
(그러나 이것은 또한 콜백 메소드에 송신 데이터 구조체로, WCF-양면 인쇄를 사용하여, 내 처음이 아니다, 정말 놀라운입니다.) 또한 그 오류가 발생한 후 내가

에 오류가 발생했습니다

화면 서비스 http://server:15450/service.svc 치명적인 오류에서 요청을 처리 할 수 ​​없습니다

편집 3 : 서비스 구성 :

<system.serviceModel> 
    <services> 
     <service name="ContactServer.Business.ContactService" 
       behaviorConfiguration="ServiceBehavior"> 
     <endpoint address="" 
        binding="wsDualHttpBinding" 
        contract="ContactServer.Business.IContactService"> 
      <identity> 
      <dns value="localhost"/> 
      </identity> 
     </endpoint> 
     <endpoint address="mex" 
        binding="mexHttpBinding" 
        contract="IMetadataExchange" 
        name="MexBinding"/> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="ServiceBehavior"> 
      <serviceMetadata httpGetEnabled="true"/> 
      <serviceDebug includeExceptionDetailInFaults="true"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 

클라이언트 구성

<system.serviceModel> 
    <bindings> 
     <wsDualHttpBinding> 
     <binding name="WSDualHttpBinding_ContactService" closeTimeout="00:01:00" 
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 
      bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
      maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" 
      textEncoding="utf-8" useDefaultWebProxy="true"> 
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
      maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
      <reliableSession ordered="true" inactivityTimeout="00:10:00" /> 
      <security mode="Message"> 
      <message clientCredentialType="Windows" negotiateServiceCredential="true" 
       algorithmSuite="Default" /> 
      </security> 
     </binding> 
     </wsDualHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="http://localhost:1408/ContactService.svc" 
     binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_ContactService" 
     contract="ServiceReference.ContactService" name="WSDualHttpBinding_ContactService"> 
     <identity> 
      <dns value="localhost" /> 
     </identity> 
     </endpoint> 
    </client> 
    </system.serviceModel> 

더 많은 정보 : 나는 또한 나는 여전히 같은 오류, with 00:01:00 Time있어 클라이언트 측에서 타임 아웃을 상승 후 .NET 3.5 및 Visual Studio 2010를 사용합니다. 왜 이런 일이 일어 났습니까?

+2

@Rev :이 이야기는 환상적이지만 우리가 필요로하는 것은 서비스 및 콜백 동작, 서비스 및 콜백 계약 등 서비스에 대한 자세한 정보입니다. 클라이언트 응용 프로그램의 유형에 대해서도 알고 있어야합니다. Btw. WCF를 통해 DataContext를 보내지 마십시오. 작동하지 않습니다. –

+1

WPF 또는 Silverlight에서 ConcurrencyMode = Reentrant를 지정해야하는 유명한 문제가있을 수 있습니다. – vorrtex

+0

@ 라디 슬라브 : 전체 데이터 컨텍스트를 서비스 또는 콜백으로 보내지 않고 하나 또는 두 개의 데이터 클래스 (단일 행 또는 목록 ) 만 보냅니다. – Rev

답변

2

문제는 WCF 서비스에서 엔터티를 전송하는 것과 관련이 있습니다. enter image description here

엔티티 프레임 워크 :

예를 들어, 우리는이 데이터베이스 모델이

public Item GetItem(int id) 
    { 
     var se = new SampleEntities(); 
     return se.Items.FirstOrDefault(i => i.Id == id); 
    } 

이 코드는 잘못하지 않는 것, 그러나 실제로는 함께 항목을 반환합니다 모든 관련 항목.

 var s = new SampleServiceClient(); 
     var item = s.GetItem(1); 
     Assert.AreEqual(item.RelatedItems.Any(), true); //equal 

데이터베이스에 다 대 다 관계가있는 경우 특히 위험합니다. 그래서 게으른 로딩 (방금 반환하기 전에 비활성화 할 수 있습니다) 비활성화해야합니다 :

var se = new SampleEntities(); 
se.ContextOptions.LazyLoadingEnabled = false; 
return se.Items.FirstOrDefault(i => i.Id == id); 

Linq에 우리는 예외가

public Item GetItem(int id) 
    { 
     var dc = new DataClasses1DataContext(); 
     return dc.Items.FirstOrDefault(i => i.Id == id); 
    } 

를 SQL로 :

있었다를 매개 변수를 serialize하는 동안 오류가 발생했습니다 : GetItemResult. InnerException 메시지가 ''WebApplication1.RelatedItem '유형의 객체 그래프에 사이클이 포함되어 있으며 참조 추적이 비활성화 된 경우 직렬화 할 수 없습니다.'

DataContext diagramm을 열고 속성 -> 직렬화 모드 -> 비 순방향을 설정해야합니다. Here은보다 완벽한 설명입니다.

+0

DataContext에서 확실히 문제 발생 – Rev