title: Register multiple endpoints of same contract in WCF and Castle windsor
body: <p>I'm looking for some help on implementing WCF Castle injection in one of my projects</p>
  
  <p>Basically, we are developing an configuration tool which would synchronize the data between our test and production environments. It would read the data from production environment and will update the data in test environments so that the test and production environments are in sync for regression testing of our applications</p>
  
  <p>So, in my application configuration file, i'm maintaining different endpoints of my service (they have different names but have same contract). I'm registering them as follows</p>
  
  <pre><code>container.Register(Component.For&lt;IService&gt;().ImplementedBy&lt;CustomServiceProxy&gt;().Named(integration));
  container.Register(Component.For&lt;IService&gt;().ImplementedBy&lt;CustomServiceProxy&gt;().Named(useracceptance));
  </code></pre>
  
  <p>The class "CustomServiceProxy" has business logic and does the data comparisons for synchronization.</p>
  
  <p>In the above code, when the components are registering, I'm facing the below exception. I have verified the endpoints mentioned in the configuration file and all the endpoints are provided with a different names so that they don't conflict each other during runtime</p>
  
  <blockquote>
    <p>An endpoint configuration section for contract 'DataSynch.IService' could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name</p>
  </blockquote>
  
  <p>My idea is to register multiple service endpoints with different dependency names and use the registered names as keys to resolve the dependencies during run time using service overrides</p>
  
  <pre><code>container.Register(Component.For&lt;IServiceFactory&lt;IService&gt;&gt;().ImplementedBy&lt;ServiceFactory&gt;().
                          ServiceOverrides(
                              ServiceOverride.ForKey(IntService).Eq(integration),
                              ServiceOverride.ForKey(UatService).Eq(useracceptance)));     
  </code></pre>
  
  <p>The same keys mentioned in the service override are being passed to constructor parameters for dependency resolutions                 </p>
  
  <p>Any quick help on this topic would be really helpful</p>