How to Host WCF REST Service and WCF Data Service in the same global.asax?

It turns out this was exceedingly simple and I completely overlooked the obvious It appears when you are hosting multiple service routes you cannot have a default/empty route prefix on any of the routes as you can with a single route. Note this was what I had in my question above for the UserService route Thus providing a route prefix for both service routes allows both services to be hosted within the same global. Asax Providing code for completeness protected override void RegisterRoutes(System.Web.Routing.

RouteCollection routeTable) { routeTable. Add(new ServiceRoute("Rest", new WebServiceHostFactory(), typeof(UserService))); routeTable. Add(new ServiceRoute("OData", new DataServiceHostFactory(), typeof(UserDataService))); }.

It turns out this was exceedingly simple and I completely overlooked the obvious. It appears when you are hosting multiple service routes you cannot have a default/empty route prefix on any of the routes as you can with a single route. Note this was what I had in my question above for the UserService route.

Thus providing a route prefix for both service routes allows both services to be hosted within the same global.asax. Providing code for completeness... protected override void RegisterRoutes(System.Web.Routing. RouteCollection routeTable) { routeTable.

Add(new ServiceRoute("Rest", new WebServiceHostFactory(), typeof(UserService))); routeTable. Add(new ServiceRoute("OData", new DataServiceHostFactory(), typeof(UserDataService))); }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions