JQuery to asmx fails on Windows 2008 R2 SP1

放肆的年华 提交于 2019-12-05 18:14:31

I was able to get this working with the following addition to my web.config

I saw another site that suggested clearing the handlers, but that made everything way worse. With this update, I was able to call my web services once again.

<system.webServer>
    <handlers>
        <add name="AsmxRoutingHandler" verb="*" path="*.asmx"  type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </handlers>
</system.webServer>

I had the same problem.

Create a Web.Config file containing the following lines:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <location path="." inheritInChildApplications="false">
        <system.web>
            <httpHandlers>
                <clear />
                <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                <add path="*" verb="GET,HEAD,POST" type="System.Web.DefaultHttpHandler" validate="True" />
            </httpHandlers>
        </system.web>
    </location>
</configuration>

Copy this into the directory(s) where you serve out your affected scripts, and restart your web server.

These lines will override your preferred HttpHandlers and set it to use the default handlers instead.

Good luck!

Judging by your screenshots, that seems an awful lot like a URL rewriting issue. Does your site have any overly-greedy URL rewrite rules at the IIS level that could be 302 redirecting /Handlers/ProductRating.asmx/RateProduct?

If you do have rewrite rules, can you try disabling them temporarily to see if that fixes the ASMX issue?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!