I have an ASP .Net MVC 3.0 web application hosted on IIS and I am using Castle Windsor version 3.0.
What I would like to do is register a WCF service using the webHttpBinding without any entries in the web.config or having a .svc file. Is this possible?
I tried this in my IWindsorInstaller implementation:
container.AddFacility<WcfFacility>(f => f.CloseTimeout = TimeSpan.Zero);
container.Register(
Component
.For<IMyService>()
.ImplementedBy<MyService>()
.AsWcfService(new DefaultServiceModel()
.AddBaseAddresses("http://localhost/WebApp/Services")
.AddEndpoints(WcfEndpoint
.BoundTo(new WebHttpBinding())
.At("MyService.serv"))
.Hosted()
.PublishMetadata()));
And I am ignoring anything that finishes serv like so in my RegisterRoutes method in global asax:
routes.IgnoreRoute("{resource}.serv/{*pathInfo}");
If I point a browser at http://localhost/WebApp/Services/MyService.serv I get a 404.
What am I doing wrong or am I trying to do something stupid (or not possible or both!)?
ServiceRoute
to register URL routing for your service but I don't know how it works with Castle Windsor. – Driven