Skip to content

Configure rest services

remogloor edited this page Mar 6, 2013 · 6 revisions

Rest services can either by configured using using svc files and configure it in the web.config or you can add the routes manually in the global.asax

For the later add a RegisterRoutes method to the global.asax like this:

```text
private void RegisterRoutes()
{
    // We replace WebServiceHostFactory with NinjectWebServiceHostFactory so Ninject can handle creation of
    // the services using the Ninjection kernel for each inbound request.
    //RouteTable.Routes.Add(new ServiceRoute("Service1", new WebServiceHostFactory(), typeof(Service1)));
    RouteTable.Routes.Add(new ServiceRoute("Service1", new NinjectWebServiceHostFactory(), typeof(Service1)));
}
```