【发布时间】: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