【问题标题】:http handler for .asmx file is throwing 401 error.asmx 文件的 http 处理程序抛出 401 错误
【发布时间】:2013-08-09 06:16:34
【问题描述】:

我已经制作了一个自定义 httphandler 来将旧的 .asmx 请求重定向到不同的服务器。

    public void ProcessRequest(HttpContext context)
    {
        int i = 0;

        string methodName = context.Request.PathInfo.Trim('/');

        string baseUrl = "http://www.example.com/xy.asmx";

        string newURL = baseUrl + "/" + methodName;

        context.Response.Redirect(newURL, false);



    }

这应该是很简单的任务,但我无缘无故地得到了未经授权的异常。 {"Message":"身份验证失败。","StackTrace":null,"ExceptionType":"System.InvalidOperationException"}

我什至禁用了身份验证。

谁能告诉我这里发生了什么。

【问题讨论】:

    标签: c# .net redirect iis-7.5 httphandler


    【解决方案1】:

    似乎这是一个发布请求,并且不允许重定向发布请求。因此出现错误。

    我不确定为什么会发生错误。但我暂时保持原样。

    -

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多