ASMX操作404s,但ASMX服务描述没有,url路由问题?

发布于 2024-10-26 21:40:02 字数 609 浏览 3 评论 0原文

所以我发现自己遇到了一个难题。我们的应用程序中有一些旧的 asmx Web 服务,多年来一直运行良好。

突然间,他们停止了构建服务器(CI)上的工作。我说停止工作,因为即使当我导航到服务时显示服务描述,调用任何操作都不会路由到服务(Web 表单路由)。在我尝试解决此问题时出现了 2 个奇怪的问题。

1.)搁置所有待处理的更改后,从 TFS 获取最新版本并进行本地构建(除非我弄错了,否则将获得构建服务器上的内容,因为我们每次签入时都会构建/推送< /em>)。我注意到我无法在本地复制该错误。

2.) 即使我无法在本地复制错误,我仍然怀疑路由,但是我们所有服务的路由都会首先添加到表中,如下所示: "{service}.asmx/{* pathInfo}",我想这是作为安全预防措施添加的,因为像 MyService.svc 这样的东西甚至不应该到达路由器,因为该文件实际上存在,尽管我不确定该规则是否适用于 MyService.svc/MyMethod

我不太确定如何测试路由,即在哪里设置断点来知道我是否正在遍历路由表无论是否有特定请求,因此该领域的任何指示以及关于为什么会发生这种情况的任何其他想法都将受到赞赏。

谢谢!

So I've found myself with a conundrum. We have some old asmx web services in our app that have worked fine for ages.

All of the sudden they stopped working on the build server (CI). I say stopped working, because even though the service description displays when I navigate to the service, invoking any operation doesn't get routed to the service (Web Form Routing). There are 2 strange issues that arose in my attempt to fix this problem.

1.) After shelving all my pending changes, grabbing latest from TFS, and doing a local build (which unless I'm mistaken, will get me what is on the build server since we build/push with each check in). I noticed that I can't duplicate the error locally.

2.) Even though I can't duplicate the error locally, I still suspect routes, however the routes for all our services are added to the table first, and look like this : "{service}.asmx/{*pathInfo}", I guess this was added as a safety precaution as something like MyService.svc shouldn't even make it to the router, as the file actually exists, though I'm not sure if that rule applies for MyService.svc/MyMethod

I'm not really sure how to test routing, i.e. where to set a break point to know if I'm going through the route table for a particular request or not, so any pointers in that area would be appreciated, as well as any other ideas as to why this might be happening.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

↘紸啶 2024-11-02 21:40:02

在绊倒这个SO条目后,我刚刚遇到了同样的错误:

处理程序在 IIS7.5 集成管道上返回 404 错误

,并尝试了将 asmx 处理程序添加到 web.configs webServer 部分的解决方案,一切顺利:

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules runAllManagedModulesForAllRequests="true"/>
    <handlers>
      <add verb="*" path="*.asmx" name="asmx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </handlers>
  </system.webServer>


I've just encountered the same error, after stumbling over this SO entry:

Handlers returns 404 error on IIS7.5 integrated pipeline

and tried the solution of adding the asmx handler to the web.configs webServer section all was well:

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules runAllManagedModulesForAllRequests="true"/>
    <handlers>
      <add verb="*" path="*.asmx" name="asmx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </handlers>
  </system.webServer>


~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文