Question

I am following the Hello Web Service tutorial on ServiceStack.net. I get the message below when trying to access the service:

Failed to load httpHandler type `ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack'

I am using xsp which I started in my working directory for the project with the default values (i.e.: port 8080). I edited the web.config in this directory as documented in the tutorial.

How does the service find the http handler? Using xsp on port 8080 will I be able to open the metadata page?

The web.config which is in the same directory as the app contains:

<configuration>

    <!-- Required for MONO -->
  <system.web>
    <httpHandlers>
      <add path="servicestack*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>
    </httpHandlers>
  </system.web>
  <!-- Required for IIS7 -->
  <system.webServer>
    <!-- ServiceStack: Required -->
    <validation validateIntegratedModeConfiguration="false"/>
  </system.webServer>

</configuration>
Was it helpful?

Solution

As mentioned I'm working with Mono and xsp. I now realize that in my working directory, MonoDevelop not only created web.config but also a bin directory which contains all of the dlls that I created and referenced in my project.

Setting xsp root directory to the path containing the web.config and ./bin enabled the http handler to be found and allowed me to finally access my web service and
http://localhost:8080/ServiceStack/metadata

In this scenario I did not need my dlls to be in /bin but in the project's bin

I had also overlooked the call to HelloAppHost().Init()

Bit of a learning curve... but I'm looking forward to using ServiceStack.

Thank you @mythz and @Mr.Young

OTHER TIPS

I think your configuration might be incorrect. You might have mixed up the configuration with the configuration for using ServiceStack with an existing web framework. The basic configuration for hosting ServiceStack at the root (/) path without any other web frameworks is

<system.web> 
   <httpHandlers> 
      <add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/> 
      </httpHandlers> 
</system.web>

Remove the servicestack* from the path and the IIS specific stuff. It's possible your running into the VERY uncool bug in Mono ASP.NET implementation of virtual paths, details here: https://groups.google.com/d/msg/servicestack/kzfS88RldIU/LsJ2jV9M2LIJ

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top