I'm cross-posting this from stack overflow, since you guys seem to be the 
go-to, here is the question 
http://stackoverflow.com/questions/9739668/how-to-host-multiple-services-using-one-wcffacility
 

I'm trying to use one WcfFacility to host multiple services under IIS. 
Everything seems to be working, but as I connect the WCF Test client to 
each service, the returned WSDL contains a composite of all the services 
that I've connected to prior to that service as well as that service. If I 
go back and refresh a service that I connected to earlier, it includes the 
endpoints for the other services. The configuration is as follows: 

var baseUri = new 
Uri(HttpContext.Current.Request.Url.GetComponents(UriComponents.SchemeAndServer,
 UriFormat.Unescaped));
 
container.AddFacility<WcfFacility>(f => { f.CloseTimeout = TimeSpan.Zero; 
}).Register(
        Component.For<IAttributeService>()                                      
                .ImplementedBy<AttributeService>()
                .AsWcfService(
                        new DefaultServiceModel()
                                .Hosted()                                       
                
                                .AddEndpoints(
                                        
WcfEndpoint.ForContract<IAttributeService>().BoundTo(new 
BasicHttpBinding()).At("Soap11"),
                                        
WcfEndpoint.ForContract<IAttributeService>().BoundTo(new 
WSHttpBinding()).At("Soap12")
                                )
                .AddBaseAddresses(new Uri(baseUri, "AttributeService.svc"))     
                                
                ),                                              
        Component.For<ISessionService>()
                .ImplementedBy<SessionService>()
                .AsWcfService(
                        new DefaultServiceModel()
                                .Hosted()                                       
                
                                .AddEndpoints(
                                        
WcfEndpoint.ForContract<ISessionService>().BoundTo(new 
BasicHttpBinding()).At("Soap11"),
                                        
WcfEndpoint.ForContract<ISessionService>().BoundTo(new 
WSHttpBinding()).At("Soap12")
                                )
                .AddBaseAddresses(new Uri(baseUri, "SessionService.svc"))
                ),                      
        Component.For<ISampleService>()
                .ImplementedBy<SampleService>()
                .AsWcfService(
                        new DefaultServiceModel()
                                .Hosted()
                                .AddEndpoints(
                                        
WcfEndpoint.ForContract<ISampleService>().BoundTo(new 
BasicHttpBinding()).At("Soap11"),
                                        
WcfEndpoint.ForContract<ISampleService>().BoundTo(new 
WSHttpBinding()).At("Soap12")
                                )
                .AddBaseAddresses(new Uri(baseUri, "SampleService.svc"))
                )
);


I'd like to add that the services seem to work regardless of where they are 
called from, so this is more an issue of potential confusion than a 
critical bug. I'm still learning WCF so maybe there is something really 
obvious going on here that I've missed.

Thanks in advance for your time!

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/castle-project-devel/-/8Hw-2YiPddcJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-devel?hl=en.

Reply via email to