Thursday, March 1, 2012

Sitecore and ServiceStack

While trying out Service Stack, I ran into the issue wherein it would not play nicely with Sitecore.

So after a bit of confusion about how location tags worked in web.config, it figured that the solution was as follows:

Include
"|/webservices"
into the IgnoreUrl variable, and add the following at the end of your web.config

<location path="webservices">
<system.web>
<httpHandlers>
<add path="webservices"
type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>
</httpHandlers>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add path="webservices" name="ServiceStack.Factory"
type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" />
</handlers>
</system.webServer>
</location>


As you can see, it's basically the MVC version of the config offered by the site, but with the path of each of the handlers set to the same name as the location.

1 comment:

  1. Thanks for this, the IgnoreUrl setting was the magic I was missing.

    ReplyDelete