We are using WCFFacility to setup services from hosted (IIS 7.5) environment. What we need is to provide two endpoints for each service, WSHttp for .NET clients and WebHttp for everyone else. Is this possible?
The code we use:
_container.Register(
Component
.For<ISomeService>()
.ImplementedBy<SomeService>()
.AsWcfService(new DefaultServiceModel()
.Hosted()
.PublishMetadata(mex => mex.EnableHttpGet())
.AddEndpoints(
WcfEndpoint.BoundTo(new WSHttpBinding()).At("v1/ws"),
WcfEndpoint.BoundTo(new WebHttpBinding()).At("v1/rest")
))
);
And then:
RouteTable.Routes.Add(new ServiceRoute("", new DefaultServiceHostFactory(_container.Kernel), typeof(ISomeService)));
I assume we can't really mix ws/web endpoints but can this be achieved somehow else? We don't want to fallback to xml configuration but we need to configure endpoints.