【发布时间】:2011-07-29 10:57:36
【问题描述】:
我有 WCF WebService,它使用 AdomdConnection 访问多维数据集数据。 服务托管在 Sharepoint Server 2010 中。
我还有调用 WCF 服务并从客户端调用的 ASCX 网络服务(使用 javascript)。一切正常,但身份验证存在问题。 两种服务(ASCX 和 WCF)都托管在 Sharepoint 中。
我在访问多维数据集数据时从 WCF 服务收到异常:
Either the user, NT AUTHORITY\IUSR, does not have access to the GMS1106 database, or the database does not exist.
这就是我从 asmx 调用 WCF 网络服务的方式:
var binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
var endpoint = new EndpointAddress(SPContext.Current.Web.Url + GmsConfigurationReader.Current.GetParameter("OlapWebserviceEnpoint"));
var channelFactory = new ChannelFactory<IDataAccessService>(binding, endpoint);
channelFactory.Credentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
channelFactory.Credentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials;
var client = channelFactory.CreateChannel();
hyperlink = client.GetFacilityHyperlink("Quarter 2 2011", "Center/Eastern Europe", "Cracow", "Machine Time Utilization");
Sharepoint appool 使用具有多维数据集权限的身份运行。
总结一下:
- 这是我访问 WCF 服务的方式:
JavaScript (client) -> ASCX -> WCF -> CUBE- 没有问题(一切都托管在 Sharepoint 2010 中) - WCF 出于某种原因使用内置帐户而不是用户凭据
我已经检查过了,如果我授予多维数据集的 NT AUTHORITY\IUSR 权限,一切正常,但我真的不想这样做。
【问题讨论】:
标签: c# wcf web-services sharepoint ssas