【发布时间】:2018-06-24 11:48:43
【问题描述】:
我有一个报表服务器 URL - http://server_name/ReportServer/ReportService2010.asmx
我正在尝试使用 C# 控制台应用程序访问服务
-
我的控制台应用程序代码,带有报告服务器的名为 ReportsService 的服务引用,代码在这里 -
static void Main(string[] args) { ReportsService.ReportingService2010SoapClient proxy = new ReportsService.ReportingService2010SoapClient(); proxy.ClientCredentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials; proxy.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation; //proxy.ClientCredentials = ""; try { ReportsService.Schedule[] schedule; ReportsService.TrustedUserHeader trustedHeader = new ReportsService.TrustedUserHeader(); string siteURL = null; proxy.ListSchedules(trustedHeader, siteURL, out schedule); } catch (Exception e) { throw; } }}
我在执行 proxy.ListSchedules() 时收到此错误消息 -
{"授予用户 'DOMAIN\user.name' 的权限不足 用于执行此操作。 ---> Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: 授予用户 'DOMAIN\user.name' 的权限不足 用于执行此操作。"}
-
App.config 文件是 -
<bindings> <basicHttpBinding> <binding name="ReportingService2010Soap"> <security mode="TransportCredentialOnly"> <transport clientCredentialType="Ntlm"></transport> </security> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://server_name:80/ReportServer/ReportService2010.asmx" binding="basicHttpBinding" bindingConfiguration="ReportingService2010Soap" contract="ReportsService.ReportingService2010Soap" name="ReportingService2010Soap" /> </client>
请告诉我如何解决此错误。
【问题讨论】: