After upgrading to Sitecore 7.5, some or all of your Web API routes have stopped working.
A new pipeline step in the
initialize pipeline might be your problem.
The pipeline step (re-)configures Web API routes, overriding some (all?) previously configured routes and/or handlers.
It is patched into the
initialize pipeline via the config include file “/App_Config/Include/Sitecore.Services.Client.config” (search for
You may experience this issue if some or all of the following apply to your project:
- You’re registering Web API routes via the Sitecore
initializepipeline, likely inspired by Patrick Delancy’s excellent article on the subject.
- You’re not using a Sitecore include file, e.g. you’ve inserted your route registration pipeline step directly into the
- Your route registration pipeline step is patched in before the new
ServicesWebApiInitializerfor any reason, e.g. you’ve explicitly patched in your pipeline processor after the
The project where I’ve experienced this issue uses a custom IHttpControllerSelector implementation which was removed/replaced by the new pipeline step.
- Continue to use Patrick Delancy’s excellent solution.
- Place the config include file described in Patrick’s article in a subdirectory of the “/App_config/Include” folder, to ensure it’s included after “/App_Config/Include/Sitecore.Services.Client.config” — e.g. save it as “/App_config/Include/My-Company/WebApiRoutes.config”.
- Use /sitecore/admin/showconfig.aspx to verify that your route registration processor is patched in after the
As mentioned above the important thing is to register your routes after the
Sitecore.Services.Infrastructure.Sitecore.Pipelines.ServicesWebApiInitializer pipeline step when running Sitecore 7.5.
The Sitecore 7.5
initialize pipeline vs. the old Sitecore 7.2 version are shown below, MVC and Web API route registration steps highlighted for convenience.