【问题标题】:SQL Server Reporting Services - Authentication issue access web serviceSQL Server Reporting Services - 身份验证问题访问 Web 服务
【发布时间】:2014-12-22 09:54:42
【问题描述】:

我有一个问题,我无法在我的生产环境中使用 SSRS Web 服务,但它可以在我的本地开发环境和测试环境中使用。唯一的区别是生产环境将 Web 服务安装在不同的服务器上,即我们的生产数据库服务器。但是,在生产 Web 服务器上的浏览器中键入 Web 服务 URL 会正确提示输入凭据,然后在提供正确凭据时加载 Web 服务 XML 定义。

我得到的异常如下所示。

System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Basic'. The authentication header received from the server was 'NTLM'. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
   --- End of inner exception stack trace ---
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.<>c__DisplayClass5`1.<CreateGenericTask>b__4(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

我的 web.config 中有以下 XML 用于访问 SSRS Web 服务。

<system.serviceModel>
  <bindings>
    <basicHttpBinding>
      <binding name="ReportingService2010Soap" sendTimeout="00:05:00" maxReceivedMessageSize="5242880">
        <security mode="TransportCredentialOnly">
          <transport clientCredentialType="Basic" proxyCredentialType="Windows" realm="54.252.119.210"/>
          <message clientCredentialType="UserName" algorithmSuite="Default"/>
        </security>
      </binding>
    </basicHttpBinding>
  </bindings>
  <client>
    <endpoint address="http://xxx/ReportServer/ReportService2010.asmx" binding="basicHttpBinding" bindingConfiguration="ReportingService2010Soap" contract="ReportServer.ReportingService2010Soap" name="ReportingService2010Soap"/>
    <endpoint address="http://xxx/ReportServer/ReportExecution2005.asmx" binding="basicHttpBinding" bindingConfiguration="ReportingService2010Soap" contract="ReportExecutionServer.ReportExecutionServiceSoap" name="ReportExecutionServiceSoap"/>
  </client>
</system.serviceModel>

我怀疑这个问题与生产数据库服务器的配置方式有关,但我不知道这可能是什么。

【问题讨论】:

    标签: asp.net wcf reporting-services


    【解决方案1】:

    原来问题在于报告服务 Web 服务未配置为使用基本身份验证。

    SSRS认证配置:http://technet.microsoft.com/en-us/library/bb283249(v=sql.105).aspx

    SSRS 基本认证配置:http://technet.microsoft.com/en-us/library/cc281309(v=sql.105).aspx

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-11-22
      • 1970-01-01
      • 2012-02-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多