How can I override a .svc file in my routing table?

Viewed 3587

I have this URL that was used from some JSON post back from the main website:

http://site/Services/api.svc/UpdateItem

We are in the process of updating the web site slowly to ASP.Net MVC 2 and don't want to break any current URL's in the system. (JavaScript refresh issues)

I have deleted the /Services/api.svc and have moved the logic for this API call into the following Controller:

http://site/LegacyApi/UpdateItem

Unfortunately, when adding the route, I can't seem to get it to override the api.svc and keep getting a 404 error.

Route:

    routes.MapRoute(
        "UpdateItemApi",
        "Services/api.svc/UpdateItem",
        new { controller = "LegacyApi", action = "UpdateItem" }
    );

According to the MSDN on this specific issue, the routing should go through.

Any help on this is greatly appreciated.


Update

Routing for standard .aspx pages works as intended, so this seems to be something perticular with the .svc files and how they are handled.

2 Answers
Related