2010-12-27 4 views
0

우리는 WCF 서비스 호출을하는 Windows 서비스를 가지고 있습니다. 일반적으로 정상적으로 작동합니다. 그러나 가끔씩 Windows 서비스를 다시 시작할 때 MessageSecurityException이 발생하고 모든 것이 던져지며 이후에 반복해서 throw됩니다.Windows Service Throw MessageSecurityException

한 가지 해결책은 AllowedImpersonationLevel을 "가장"으로 설정하는 것입니다. 그러나 우리는 가장 (impersonation)을 사용하지 않습니다. 또한 임의의 문제이며 항상 재현 할 수있는 것은 아닙니다. 따라서이 솔루션은 부적절합니다.

누구든지이 부분에 쏟아 낼 수있는 빛은 높이 평가됩니다.

오류 메시지의 스택 추적 :

2010-12-24 23:18:42,581 [3] ERROR [DataSync] – An error occured during Data Sync [(null)] System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme ‘Negotiate’. The authentication header received from the server was ‘Negotiate,NTLM’. -> System.Net.WebException: The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest.GetResponse() at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) —End of inner exception stack trace --

Server stack trace: at System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication(HttpWebRequest request, HttpWebResponse response, WebException responseException, HttpChannelFactory factory) at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException, ChannelBinding channelBinding) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

+0

IIS에서 호스팅되는 WCF 서비스가 반대입니까? 그렇다면 사용자가 IIS 로그의 실패 요청을 기록했는지 확인하십시오. – amit

답변

0

이 환경 문제입니다. 컴퓨터가 도메인 컨트롤러에 연결할 수 없으므로 인증을 수행하지 못하여이 간헐적 인 문제가 발생했습니다.