【发布时间】:2011-02-24 16:54:56
【问题描述】:
简而言之,我的场景是这样的:
- 用户在 Web 浏览器中触发一个操作,这会导致对 Web 服务器(服务器 A)中的 Web 服务的 Ajax 调用。
- Web 服务器向 IIS 中托管的 WCF 服务发出调用(服务器 B)
- WCF 服务向 IIS 中托管的另一个 WCF 服务发出调用(服务器 C)
所有网站都通过 http 而非 https 公开。
现在,服务器 C 需要知道另一端的用户是谁。到目前为止,我已经让它工作了,因此对服务器 B 的 WCF 服务调用是在模拟下执行的,因此服务器 B 有一个代表用户的 WindowsIdentity 对象。但是,当我尝试在模拟下调用从服务器 B 到服务器 C 的服务调用时,我得到以下信息:
System.ComponentModel.Win32Exception: No credentials are available in the security package
Server stack trace:
at System.IdentityModel.SspiWrapper.AcquireCredentialsHandle(String package, CredentialUse intent, AuthIdentityEx& authdata)
at System.ServiceModel.Security.SecurityUtils.GetCredentialsHandle(String package, NetworkCredential credential, Boolean isServer, String[] additionalPackages)
at System.ServiceModel.Security.SpnegoTokenProvider.OnOpening()
at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpening()
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Security.CommunicationObjectSecurityTokenProvider.Open(TimeSpan timeout)
at System.ServiceModel.Security.SecurityUtils.OpenTokenProviderIfRequired(SecurityTokenProvider tokenProvider, TimeSpan timeout)
at System.ServiceModel.Security.SymmetricSecurityProtocol.OnOpen(TimeSpan timeout)
at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.SecurityChannelFactory`1.ClientSecurityChannel`1.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)
调整服务绑定对我来说就像在冰上行走一样薄,我几乎是在水上行走,所以让我们忽略到目前为止我失败的地方,并从一张干净的床单开始。
我应该如何配置服务以使其彼此(和我)很好地配合?
【问题讨论】:
-
你的用户是来自 xkcd 的人吗? :-)
标签: .net asp.net wcf wcf-binding