1

WCF サービスがあり、それがlocalhostにデプロイされている場合は、サービス メソッドを呼び出すことができます。つまり、すべて正常に動作します。

しかし、サービスを別のサーバーにデプロイすると、エラーが発生します。

System.ServiceModel.Security.SecurityNegotiationException occurred
  Message="The caller was not authenticated by the service."
  Source="mscorlib"
  StackTrace:
    Server stack trace:
        System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)
        System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout)
        System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)
        System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
        System.ServiceModel.Security.CommunicationObjectSecurityTokenProvider.Open(TimeSpan timeout)
        System.ServiceModel.Security.SecurityUtils.OpenTokenProviderIfRequired(SecurityTokenProvider tokenProvider, TimeSpan timeout)
        System.ServiceModel.Security.SymmetricSecurityProtocol.OnOpen(TimeSpan timeout)
        System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)
        System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
        System.ServiceModel.Channels.SecurityChannelFactory`1.ClientSecurityChannel`1.OnOpen(TimeSpan timeout)
        System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
        System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout)
        System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout)
        CryptoPro.Sharpei.ServiceModel.CPSecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout)
        System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout)
        System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.OnOpen(TimeSpan timeout)
        System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
        System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
        System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
        System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
        System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
        System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
        System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
        System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
        System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
        System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]:
        System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
        System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
        Parus.BusinessObjects.ExternalServicesProxy.IAsurService.LoadCatalogItems(Decimal rn)
        Parus.BusinessObjects.ExternalServicesProxy.AsurServiceClient.LoadCatalogItems(Decimal rn) ? F:\!Work\8561\src\P8WebClient\Sources\Parus.BusinessObjects\Service References\ExternalServicesProxy\Reference.cs:?????? 154
        Parus.BusinessObjects.AsurDictionaries.AsurDictionariesLoader.Execute(ExternalAction action, ContentProvider contentProvider, IContextValueHolder contextValueHolder, ActionContext actionContext, OracleConnection connection) ? F:\!Work\8561\src\P8WebClient\Sources\Parus.BusinessObjects\AsurDictionaries\AsurDictionariesLoader.cs:?????? 19
  InnerException: System.ServiceModel.FaultException
       Message="Запрос маркера безопасности не удалось удовлетворить из-за сбоя проверки подлинности."
       Source="System.ServiceModel"
       Action="http://www.w3.org/2005/08/addressing/soap/fault"
       StackTrace:
            ? System.ServiceModel.Security.SecurityUtils.ThrowIfNegotiationFault(Message message, EndpointAddress target)
            ? System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState)
       InnerException:

web.config ファイルのいくつかの設定を変更する必要があると思いますが、サービス側 (サーバー上) またはクライアント側、またはその両方で、どれをどこに配置する必要があるかわかりません。

4

0 に答える 0