ASMX service works on development server, returns 404 when deployed to IIS 7.5
I've just encountered the same error, after stumbling over this SO entry:
Handlers returns 404 error on IIS7.5 integrated pipeline and
ASMX operation 404s, but ASMX service description doesn't, url routing issue?
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>
I was posting to asmx with jQuery and it worked in test systems, but failed on the production server. I was missing the datatype parameter:
$.ajax({ type: "POST", contentType: "application/json; charset=utf-8", data: JSON.stringify({ //Data goes here }), dataType: "json", //<<<<<<<<< This is critical for the post to succeed in production. Without it we get a 404. url: "/yourPathHere/yourEndpoint.asmx/methodName", error: function (jqxhr, status) { //error handler }, success: function (data, status) { //succes handler } });