Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows WCF服务:未注册上下文id=(密钥生成id=)的SecurityContextSecurityToken_Windows_Wcf_Service - Fatal编程技术网

Windows WCF服务:未注册上下文id=(密钥生成id=)的SecurityContextSecurityToken

Windows WCF服务:未注册上下文id=(密钥生成id=)的SecurityContextSecurityToken,windows,wcf,service,Windows,Wcf,Service,在此处输入代码Hi All 我有一个简单的windows服务应用程序,可以连接到WCF服务。windows服务部署在开发应用程序服务器上,WCF服务部署在开发Web服务器上。该服务被设置为在适当的服务帐户下运行(我们还有两个其他服务,它们也与位于相同帐户下运行的相同服务器上的WCF服务进行通信) 我的问题是,当服务尝试连接到WCF服务时,它会出现以下错误消息(从服务跟踪日志中获得): 未注册上下文id为urn:uuid:a02a1879-3297-4dee-8035-68eb30ed4195(密

在此处输入代码
Hi All

我有一个简单的windows服务应用程序,可以连接到WCF服务。windows服务部署在开发应用程序服务器上,WCF服务部署在开发Web服务器上。该服务被设置为在适当的服务帐户下运行(我们还有两个其他服务,它们也与位于相同帐户下运行的相同服务器上的WCF服务进行通信)

我的问题是,当服务尝试连接到WCF服务时,它会出现以下错误消息(从服务跟踪日志中获得):

未注册上下文id为urn:uuid:a02a1879-3297-4dee-8035-68eb30ed4195(密钥生成id=)的SecurityContextSecurityToken

该服务在运行我的本地计算机时运行良好(然后我使用自己的域帐户运行该服务),是的,该服务在昨天部署后运行良好。但从今天起,情况突然不一样了:(

WCF服务配置的设置如下所示:

<system.serviceModel>
<diagnostics>
  <messageLogging logMalformedMessages="true" logMessagesAtTransportLevel="true" />
</diagnostics>
<services>
  <service name="Calm.Leads.ImportService.LeadImportService" 
  behaviorConfiguration="Calm.Leads.ImportService.LeadImportService">
    <!-- Service Endpoints -->
    <endpoint address="" binding="wsHttpBinding" contract="Calm.Leads.ImportService.ILeadImportService">
      <!-- 
          Upon deployment, the following identity element should be removed or replaced to reflect the 
          identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
          automatically.
      -->
      <identity>
        <dns value="localhost"/>
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="Calm.Leads.ImportService.LeadImportService">
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="true"/>
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>

客户端配置如下所示:

<system.serviceModel>
<bindings>
  <wsHttpBinding>
    <binding name="WSHttpBinding_ILeadImportService" 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" allowCookies="false">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
      maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
      <security mode="Message">
        <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
        <message clientCredentialType="Windows" negotiateServiceCredential="true" 
        algorithmSuite="Default" establishSecurityContext="true" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<client>
  <endpoint address="http://calm.intranet.dev/LeadsImportService/LeadImportService.svc" 
  binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ILeadImportService" 
  contract="LeadImportService.ILeadImportService" name="WSHttpBinding_ILeadImportService">
    <identity>
      <dns value="localhost" />
    </identity>
  </endpoint>
</client>

最后,异常的跟踪如下所示:

<system.serviceModel>
<bindings>
  <wsHttpBinding>
    <binding name="WSHttpBinding_ILeadImportService" 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" allowCookies="false">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
      maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
      <security mode="Message">
        <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
        <message clientCredentialType="Windows" negotiateServiceCredential="true" 
        algorithmSuite="Default" establishSecurityContext="true" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<client>
  <endpoint address="http://calm.intranet.dev/LeadsImportService/LeadImportService.svc" 
  binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ILeadImportService" 
  contract="LeadImportService.ILeadImportService" name="WSHttpBinding_ILeadImportService">
    <identity>
      <dns value="localhost" />
    </identity>
  </endpoint>
</client>
未注册上下文id为urn:uuid:a02a1879-3297-4dee-8035-68eb30ed4195(密钥生成id=)的SecurityContextSecurityToken。 在System.ServiceModel.Security.WSSecureConversation.SecurityContextTokenEntry.ReadTokenCore(XmlDictionaryReader reader, SecurityTokenResolver(令牌解析器) 位于System.ServiceModel.Security.WSSecurityTokenSerializer.ReadTokenCore(XmlReader阅读器,SecurityTokenResolver tokenResolver) 位于System.IdentityModel.Selectors.SecurityTokenSerializer.ReadToken(XmlReader阅读器,SecurityTokenResolver tokenResolver) 位于System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlReader阅读器,SecurityTokenResolver tokenResolver,IList
1
允许的TokenAuthenticator、SecurityTokenAuthenticator和usedTokenAuthenticator)
在System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlDictionaryReader阅读器,Int32位置,字节[]decryptedBuffer,
SecurityToken encryptionToken,字符串ID EncryptedForm,TimeSpan超时)
位于System.ServiceModel.Security.ReceiveSecurityHeader.ExecuteLPass(XmlDictionaryReader阅读器)
在System.ServiceModel.Security.StrictModeSecurityHeaderRelementInferenceEngine.ExecuteProcessingPass(ReceiveSecurityHeader securityHeader,
XmlDictionaryReader阅读器)
位于System.ServiceModel.Security.ReceiveSecurityHeader.Process(TimeSpan超时)
在System.ServiceModel.Security.MessageSecurityProtocol.ProcessSecurityHeader(ReceiveSecurityHeader securityHeader、Message&;Message、,
需要SecurityToken签名Token、TimeSpan超时、SecurityProtocolCorrelationState[]相关状态)
在System.ServiceModel.Security.SymmetricSecurityProtocol.VerifyIncomingMessageCore(消息和消息、字符串参与者、时间跨度超时、,
SecurityProtocolCorrelationState[]相关状态)
在System.ServiceModel.Security.MessageSecurityProtocol.VerifyIncomingMessage(消息和消息,TimeSpan超时,
SecurityProtocolCorrelationState[]相关状态)
在System.ServiceModel.Channel.SecurityChannel Listener中
1.ServerSecurityChannel
1.VerifyIncomingMessage(消息和消息,时间跨度
超时,SecurityProtocolCorrelationState[]correlationState)
在System.ServiceModel.Channel.SecurityChannel Listener中
1.SecurityReplyChannel.ProcessReceivedRequest(RequestContext RequestContext,TimeSpan 超时) 在System.ServiceModel.Channels.SecurityChannelListener
1.ReceivereRequestAndVerifySecurityAsyncResult.ProcessInnerItem(请求上下文
innerItem,TimeSpan超时)
在System.ServiceModel.Channels.SecurityChannelListener上
1.ReceiveItem和VerifySecurityAsyncResult
2.OnInnerReceiveDone()
在
System.ServiceModel.Channels.SecurityChannelListener
1.ReceiveItemAndVerifySecurityAsyncResult
2.InnerTryReceiveCompletedCallback(IAsyncResult
结果)
位于System.ServiceModel.Diagnostics.Utility.AsynctRunk.UnhandledExceptionFrame(IAsyncResult结果)
位于System.ServiceModel.AsyncResult.Complete(布尔值同步完成)
位于System.ServiceModel.Channels.InputQueue
1.AsyncQueueReader.Set(项) 在System.ServiceModel.Channels.InputQueue
1.Dispatch()处
位于System.ServiceModel.Channels.InputQueue
1.OnDispatchCallback(对象状态) 位于System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke2()处 位于System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.OnSecurityContextCallback(对象o) 在System.Security.SecurityContext.Run(SecurityContext SecurityContext、ContextCallback回调、对象状态) 在System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke()中 在System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ProcessCallbacks()中 位于System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.CompletionCallback(对象状态) 在System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ScheduledOverlapped.IOCallback(UInt32错误代码,UInt32个字节, NativeOverlapped*NativeOverlapped) 在System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32错误,UInt32字节读取,本机重叠* 本地(重叠) 在System.Threading.\u IOCompletionCallback.PerformiCompletionCallback(UInt32错误代码,UInt32个字节,本机重叠*pOVERLAP)

Web服务器和应用程序服务器都是Windows Server 2003 SP1计算机,其中