My endpoints specify which interface is used to govern the WCF service. Because it’s an interface, I can have multiple different concrete classes implement the interface’s functionality. How do I specify which concrete class should be used for a given WCF service’s endpoint?
How do you say for this endpoint, use this concrete class and for that endpoint, use that concrete class when both endpoints use the same interface?
The contract implementation type to use is defined when the
ServiceHostinstance is created. If you have multiple endpoints served by the same ServiceHost, it will create an instance of the same type to respond to requests to these endpoints.If you want two endpoints for the same contract to use different implementations, you have two choices:
ServiceHostinstances or specifying two<service>configuration elements);I personally would stick with the first approach. If you go for the second approach, you would be essentially reimplementing
ServiceHostyourself.