2013-05-30 8 views
2

이 문제는 이미 반복적으로 제기되었지만 해결책이 사람들의 프로젝트에 있었는지 여부에 관계없이 나에게 도움이되지 않습니다.WsDualHttpBinding이 클라이언트에게 적절한시기에 문제를 호소하지 않습니다.

클라이언트에서 서비스를 호출하는 WsDualHttpBinding이 있습니다. 동일한 시스템에 로컬 모드에서

<client> 
     <endpoint address="http://{ipadress}:60379/ConfigurationCompleterService.svc" 
      binding="wsDualHttpBinding" bindingConfiguration="wsDualHttpBindingConfiguration" 
      contract="InfluxConfigurationCompleterService.IConfigurationCompleterService" 
      name="WSDualHttpBinding_IConfigurationCompleterService"> 
      <identity> 
       <userPrincipalName value="{domain-username}" /> 
      </identity> 
     </endpoint> 
     <!--wsDualHttpBindingConfiguration--> 
     <endpoint address="http://{ipadress}:60379/ConfigurationImportService.svc" 
      binding="wsDualHttpBinding" bindingConfiguration="wsDualHttpBindingConfiguration" 
      contract="ConfigurationImportServiceReference.IConfigurationImportService" 
      name="WSDualHttpBinding_IConfigurationImportService"> 
      <identity> 
       <userPrincipalName value="{domain-username}" /> 
      </identity> 
     </endpoint> 
    </client> 

이 작품 :

<bindings> 
    <wsDualHttpBinding> 
    <binding name="wsDualHttpBindingConfiguration" closeTimeout="00:01:00" 
     openTimeout="00:01:00" receiveTimeout="00:05:00" bypassProxyOnLocal="true" /> 
    </wsDualHttpBinding> 
</bindings> 

내 고객이 조금 더 다음과 같이 정의된다 : 클라이언트에 대한 내 설정이 있습니다. 서버에 서비스를 배포하고 클라이언트를 시작하면 1 분 시간 초과 후 다음 오류 메시지가 나타납니다.

처리되지 않은 예외 : System.ServiceModel.CommunicationException : 원격 상대방이 회신을 보내지 않아 보안 협상에 실패했습니다. 적시에. 기본 전송 연결이 중단 되었기 때문일 수 있습니다.

나는이 문제가 포트 (그러나 여기서 80 가지가 아닌 다른 포트에 특별히 배치 됨) 또는 보안 문제로 인해 발생한다는 것을 알고 있습니다.

그래서 난 내 바인딩 구성에 보안 속성을 삽입하려고 :

<security mode="none" />

<security mode="message"><message clientCredentialType="None"/></security> 

내가 기억하지 못하는 다른 사람을. VS2012에서 정상적으로 작동하는 동안 동일한 시스템에서도 서비스를받을 수 없습니다.

내 서비스는 잘 호스팅되어 있으며 웹 브라우저와 멀리있는 컴퓨터에서 연결할 수 있습니다.

미리 감사드립니다.

추신 : 절대적으로 안전하지 않은 방식으로 WsDualHttpBinding을 구성 할 수있는 방법이 있습니까? 그러면 자격 증명을 전혀 요구하지 않겠습니까?

답변

0

동일한 문제가 있었지만 클라이언트 코드로 인해 발생했습니다. 예 :

WSDualHttpBinding binding = new WSDualHttpBinding(); 
binding.Security.Mode = WSDualHttpSecurityMode.None; <-- I forgot this line. 
EndpointAddress endpoint = new EndpointAddress("http://localhost/CardService.svc"); 
DuplexChannelFactory<ICardService> channelFactory = new DuplexChannelFactory<ICardService>(this, binding, endpoint); 
ICardService channel = channelFactory.CreateChannel(); 
string message = "Hello, service."; 
Console.WriteLine("Successfully created the channel. Pinging it with message \"{0}\".", message); 
channel.Ping(message); 
Console.WriteLine("Successfully pinged the channel.");