小编jmm*_*312的帖子

Reporting Services 2008:"HTTP状态401:未授权"问题

每当我尝试在报告服务器上列出报告时,我收到错误"请求失败并显示HTTP状态401:未经授权".奇怪的是,当我在我的开发机器上运行asp.net应用程序到服务器报告服务Web服务URL(http://www.example.com/reports/reportservice2005.asmx?wsdl)但是当asp时.net app安装在服务器上(运行iis 7)命中相同的url我收到错误.这是我的设置:

服务器:

SQL Server Reporting Services 2008(不是R2)

Web服务网址:http://www.example.com/reports/reportservice2005.asmx?wsdl

客户

创建了一个代理ReportingServices2005.cs

Web.config有

列出报告的代码:

<asp:ListView ID="lvReportList" runat="server">
<LayoutTemplate>
    <ul>
        <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
    </ul>
</LayoutTemplate>
<ItemTemplate>
    <li>
        <asp:HyperLink runat="server" ID="hpReportLink" NavigateUrl='<%#Eval("Url")%>'><%#Eval("Name")%></asp:HyperLink>
    </li>
</ItemTemplate>
<EmptyDataTemplate>
    <div>
        No reports to display.
    </div>
</EmptyDataTemplate>
Run Code Online (Sandbox Code Playgroud)

代码背后:

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
    string rWebServiceUrl = ConfigurationManager.AppSettings["RSWebserviceUrl"];
    string reportServerFolder = ConfigurationManager.AppSettings["ReportServerFolder"];
    string domain = ConfigurationManager.AppSettings["RSDomain"];
    string userName = ConfigurationManager.AppSettings["RSUsername"];
    string password = ConfigurationManager.AppSettings["RSPassword"];

    objRS.Url = rWebServiceUrl;
    objRS.Credentials …
Run Code Online (Sandbox Code Playgroud)

c# sql web-services ssrs-2008

9
推荐指数
1
解决办法
2万
查看次数

ASP.NET MVC5:从作用域中看不到具有匹配'AutofacWebRequest'的标记的作用域

我在使用autofac v3.5.0,Autofac.Extras.CommonServiceLocator v3.2.0,Autofac.Mvc5 v3.3.2以及targetframework net45的ASP.NET MVC 5应用程序中遇到错误:

No scope with a Tag matching 'AutofacWebRequest' is visible from the scope in which the instance was requested. This generally indicates that a component registered as per-HTTP request is being requested by a SingleInstance() component (or a similar scenario.) Under the web integration always request dependencies from the DependencyResolver.Current or ILifetimeScopeProvider.RequestLifetime, never from the container itself.

当试图转换以下Rhino-Security windsor映射时:

WindsorServiceLocator windsorServiceLocator = new WindsorServiceLocator(container);
ServiceLocator.SetLocatorProvider(() => windsorServiceLocator);

    container.Register(
            Component.For<IAuthorizationService>()
                .ImplementedBy<AuthorizationService>()
                .Lifestyle.Is(Lifestyle.Transient),
            Component.For<IAuthorizationRepository>()
                .ImplementedBy<AuthorizationRepository>()
                .Lifestyle.Is(Lifestyle.Transient), …
Run Code Online (Sandbox Code Playgroud)

c# inversion-of-control autofac asp.net-mvc-5

8
推荐指数
1
解决办法
6063
查看次数