Search code examples
macosmonoservicestackxsp

servicestack hello failed to load http handler


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>

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