ASMX operation 404s, but ASMX service description doesn#39;t, url routing issue?(ASMX操作404s,但是ASMX服务描述没有,url路由问题?)
问题描述
所以我发现自己遇到了一个难题.我们的应用程序中有一些旧的 asmx Web 服务,它们运行良好.
他们突然停止在构建服务器 (CI) 上工作.我说停止工作,因为即使在我导航到服务时显示服务描述,调用任何操作也不会被路由到服务(Web 表单路由).在我尝试解决此问题时出现了 2 个奇怪的问题.
1.) 在搁置所有待处理的更改后,从 TFS 中获取最新信息,并进行本地构建(除非我弄错了,否则会得到构建服务器上的内容,因为我们构建/推送每个签到).我注意到我无法在本地复制错误.
2.) 即使我无法在本地复制错误,我仍然怀疑路由,但是我们所有服务的路由首先添加到表中,如下所示:"{service}.asmx/*pathInfo}"
,我想这是作为安全预防措施添加的,因为像 MyService.svc 这样的东西甚至不应该进入路由器,因为该文件实际上存在,尽管我不确定该规则是否适用于 MyService.svc/MyMethod
我不太确定如何测试路由,即在哪里设置断点以了解我是否正在针对特定请求遍历路由表,因此将不胜感激该区域的任何指针,如以及关于为什么会发生这种情况的任何其他想法.
谢谢!
我刚刚遇到了同样的错误,在绊倒这个 SO 条目后:
处理程序在 IIS7.5 集成管道上返回 404 错误
并尝试将 asmx 处理程序添加到 web.configs webServer 部分的解决方案一切正常:
<前><system.webServer><validation validateIntegratedModeConfiguration="false"/><modules runAllManagedModulesForAllRequests="true"/><处理程序><add verb="*" path="*.asmx" name="asmx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></处理程序></system.webServer>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!
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>
这篇关于ASMX操作404s,但是ASMX服务描述没有,url路由问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:ASMX操作404s,但是ASMX服务描述没有,url路由问题
基础教程推荐
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- c# Math.Sqrt 实现 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01