Je reçois cette erreur lors d'un appel à un service WCF d'une application ASP.Net:exception aléatoire AuthenticationManager CustomTargetNameDictionary lorsque vous appelez un service WCF
Unhandled Exception: System.InvalidOperationException
System.InvalidOperationException: The entry found in AuthenticationManager's CustomTargetNameDictionary for {URL} does not match the requested identity of host/{Hostname}.
Server stack trace:
at System.ServiceModel.Channels.HttpTransportSecurityHelpers.AddIdentityMapping(Uri via, EndpointAddress target)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.PrepareOpen()
at System.ServiceModel.Channels.HttpsChannelFactory.HttpsRequestChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(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)
La partie étrange à ce sujet est que je ne peux pas le reproduire sur n'importe quelle machine autre que nos serveurs web de production, et cela n'arrive que sporadiquement. Le service nécessite l'authentification Active Directory, mais je suis sûr que l'utilisateur possède le bon ensemble d'autorisations.
Cela ne semble pas être un problème avec la configuration WCF car cela fonctionne parfois, et d'autres applications font des appels au même service sans erreur.
J'ai déjà essayé de recréer complètement l'utilisateur, en recréant le pool d'applications dans lequel il s'exécute et en réinstallant l'application. Merci pour l'aide!