I have a WCF REST web service that is hosted via a service route in global.asax which looks like this;
protected override void RegisterRoutes(System.Web.Routing.RouteCollection routeTable)
{
routeTable.Add(new ServiceRoute("", new WebServiceHostFactory(),
typeof(UserService)));
}
I am wondering whether or not it is possible to also host another web service (which is a WCF Data Service) in the same application.
protected override void RegisterRoutes(System.Web.Routing.RouteCollection routeTable)
{
routeTable.Add(new ServiceRoute("", new WebServiceHostFactory(),
typeof(UserService)));
routeTable.Add(new ServiceRoute("OData", new DataServiceHostFactory(),
typeof(UserDataService)));
}
Attempting to navigate in my browser to http://localhost:port/ brings up the standard REST service fine whilst navigating to http://localhost:port/OData brings up the 'end point not found page'.
The reason for this is that I have legacy code in the REST service I need to keep around but also want to expose some pure data via the data service.