首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何使用自定义身份验证扩展连接到SSRS API

如何使用自定义身份验证扩展连接到SSRS API
EN

Stack Overflow用户
提问于 2015-04-19 02:13:28
回答 1查看 2.2K关注 0票数 2

我之前设置了一个应用程序来使用ReportExecutionServiceSoapClient连接到SSRS并运行报告,但是由于实现了自定义的安全扩展,我不能再连接了。这是我一直在尝试的。我一直收到500个错误。我可以很好地登录到报告管理器,但是API不工作。

代码语言:javascript
运行
复制
ReportExecution.ReportExecutionServiceSoapClient rsExec = new ReportExecution.ReportExecutionServiceSoapClient();

        rsExec.ClientCredentials.UserName.UserName = "username";
        rsExec.ClientCredentials.UserName.Password = "password";
        byte[] results = null;
        TrustedUserHeader trusteduserHeader = new TrustedUserHeader();
        ExecutionInfo execInfo = new ExecutionInfo();
        ExecutionHeader execHeader = new ExecutionHeader();

        // Load the report
        string reportPath = selReport.Path;
        string historyID = null;
        ServerInfoHeader serviceInfo = new ServerInfoHeader();
        rsExec.LoadReport(trusteduserHeader, reportPath, historyID, out serviceInfo, out execInfo);

这是我的Web.config

代码语言:javascript
运行
复制
  <system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="ReportingService2010Soap" />
    <binding name="ReportExecutionServiceSoap" />
  </basicHttpBinding>
</bindings>
<client>
  <endpoint address="REMOVED/ReportServer/ReportExecution2005.asmx"
    binding="basicHttpBinding" bindingConfiguration="ReportExecutionServiceSoap"
    contract="ReportExecution.ReportExecutionServiceSoap" name="ReportExecutionServiceSoap" />
  <endpoint address="REMOVED/ReportServer/ReportService2010.asmx"
    binding="basicHttpBinding" bindingConfiguration="ReportingService2010Soap"
    contract="ReportService.ReportingService2010Soap" name="ReportingService2010Soap" />
</client>

“{”远程服务器返回错误:(500)内部服务器错误。“}”

这个错误发生在loadreport调用中。唯一阻止它工作的更改是身份验证。我添加了两行用户名和密码,并删除了这两行

代码语言:javascript
运行
复制
  rsExec.ClientCredentials.Windows.ClientCredential = (System.Net.NetworkCredential)System.Net.CredentialCache.DefaultCredentials;
        rsExec.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;

可以不使用自定义身份验证来连接API吗?这就是我如何将SSRS改为自定义身份验证http://www.codeproject.com/Articles/675943/SSRS-Forms-Authentication的方式。

任何帮助都将不胜感激。我总是找不到,到处搜索。

EN

回答 1

Stack Overflow用户

发布于 2017-06-24 07:24:50

这对我很有效:

代码语言:javascript
运行
复制
System.Net.NetworkCredential clientCredentials = new System.Net.NetworkCredential(ReportServerUserName, ReportServerPassword);
rsExec.Credentials = clientCredentials;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29721009

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档