Hot answers tagged

10

You have most of the pieces you need, but not all. You need a patch config <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <initialize> <processor patch:before="processor[@type='Sitecore.Mvc.Pipelines.Loader.InitializeRoutes, Sitecore.Mvc']" type="...


3

MapRoute is meant for MVC controllers whereas MapHttpRoute is meant for Web API controllers. ServiceApiController is ApiController, and you should register your route with MapHttpRoute instead of MapRoute. Just register your route with: GlobalConfiguration.Configure(config => { config.Routes.MapHttpRoute("botroutes", "api/messages", new { ...


2

As described in this blog post -https://letsdositecore.wordpress.com/2018/11/13/possibly-simplest-way-of-enabling-dependency-injection-in-sitecore-controllers-and-apicontrollers/ , you can use a ServiceConfigurator to register your API controllers using Sitecore DI. Don't forget to patch it in. namespace Feature.GenericCallout { public class ...


1

It is not supported. They both are used only for accessing items content, CRUD operations over an item and items searching. You can find full API overview in official developer guides: Sitecore Service Client Item Web API


1

From the exception it looks like it's ViewContext missing. I'm not sure why it happens in your scenario but to fix this you can try the following code: @using (Sitecore.Mvc.Common.ContextService.Get().Push(Html.ViewContext)) { @Html.Sitecore().Rendering() } It will make sure that ViewContext is pushed to the ContextService.


Only top voted, non community-wiki answers of a minimum length are eligible