jsdebug Web服务方法名称无效

时间:2013-05-14 14:08:19

标签: asp.net web-services iis-7 asp.net-ajax

我最近将我们开发区域中的多个网站从x86 Windows 2003(IIS6)迁移到x64 Windows 2008 R2(IIS7)。我使用“msdeploy”进行迁移。最初我迁移了整个服务器,但遇到了问题所以我最终只是迁移IIS配置减去脚本映射。经过一些配置更改后,我终于能够在集成模式下获得.NET 3.5站点服务页面。但是,我对主母版页的这一部分存在问题:

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
<Services>
  <asp:ServiceReference Path="~/AjaxServices/FormSubmissionService.asmx" />
  <asp:ServiceReference Path="~/AjaxServices/GMapDataService.asmx" />
  <asp:ServiceReference Path="~/AjaxServices/ImageGalleryService.asmx" />
  <asp:ServiceReference Path="~/AjaxServices/MyFavoritesService.asmx" />
</Services>

每个都会生成一个脚本标记,如:

<script src="../AjaxServices/FormSubmissionService.asmx/jsdebug" type="text/javascript"></script>
<script src="../AjaxServices/GMapDataService.asmx/jsdebug" type="text/javascript"></script>
<script src="../AjaxServices/ImageGalleryService.asmx/jsdebug" type="text/javascript"></script>
<script src="../AjaxServices/MyFavoritesService.asmx/jsdebug" type="text/javascript"></script>

正在访问网络服务,但在尝试访问“jsdebug”时出现以下错误:

System.InvalidOperationException: jsdebug Web Service method name is not valid.
   at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
   at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response)
   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
  • 该网站的应用程序池是v2.0.050727集成。
  • “启用32位Applicaitons = false”(翻转此功能无效)。
  • 该网站是为“任何CPU”构建的。
  • 我在本地的Win7盒子上运行II7下的同一站点 一切顺利。我看到的唯一区别是应用程序池是 以“经典”模式运行。我尝试将服务器切换到“经典”模式 相同的结果。
  • 我尝试设置debug="false",但我得到了同样的错误(除了/ js而不是/ jsdebug)
  • 我已多次运行aspnet_regiis -i。 x64版本的2.0和4.0
  • 我已多次通过角色管理器重新安装IIS和.NET 3.5.1
  • 我可以访问每个Web服务定义页面

我想重新安装/修复.net 2.0,但这在WinServer 2008中似乎不可能。我在别处读到重新安装操作系统是实现此目的的唯一方法。那不是一个选择。

我错过了某处的配置吗?任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:2)

想通了。我将此处理程序添加到web.config中system.webServer / handlers下的列表顶部。脚本现在加载好了

<add name="ScriptHandlerFactory" path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" modules="ManagedPipelineHandler" scriptProcessor="" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="integratedMode" responseBufferLimit="4194304"/>

我实际上在列表中有这个处理程序,但它引用了4.0,它出现在“* .asmx”的2.0处理程序之后