代码之家  ›  专栏  ›  技术社区  ›  LeJeune

Visual Studio 2005-为安全Web服务添加Web引用失败

  •  0
  • LeJeune  · 技术社区  · 17 年前

    我在一个目录中有一个需要表单身份验证的Web服务(asmx文件)

    当我尝试通过VS2005添加WebReference时,我收到以下错误:

    The request failed with the error message:
    --
    <html><head><title>Object moved</title></head><body>
    <h2>Object moved to <a href="/webchat/login.aspx?ReturnUrl=%2fwebchat%WebService.asmx">here</a>.</h2>
    </body></html>
    

    当我删除该目录中的web.config(基本上删除了表单身份验证的要求)时,一切正常。我可以添加WebReference。

    知道吗?

    1 回复  |  直到 17 年前
        1
  •  2
  •   maxnk    17 年前

    将以下代码放入web.config中:

    <location path="path/to/your/service.asmx">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization>
        </system.web>
    </location>
    

    ASP。Net允许覆盖特定位置的应用程序范围设置。

    推荐文章