title: Programatically configure individual WCF operations with different WCF configurations
body: <p>I am just getting started with WCF and would like to set up a distributable networked system as follows: (but am not sure if it is possible.)</p>
  
  <p>I have a .net client that has business logic. It will need various data from various sources so I would like to add a 'server' that contains an in-memory cache but also WCF capabilities to send/receive and publish/subscribe from data sources for data that is not cached. I think it should be possible for these server applications to be identical in terms of code, but highly configurable so that requests could be dealt with in a peer to peer fashion, or traditional client-server as required. I <em>think</em> it could be done so that essentially a server sends a request to wherever it has the endpoint configured and gets a response.</p>
  
  <p>Essentially a server would be configured as below:</p>
  
  <pre><code>Server A
  ========
  
  Operation 1 - Endpoint I
  Operation 2 - Endpoint II
  
  
  Server B
  ========
  
  Operation 1 - Endpoint IV
  Operation 2 - Endpoint III
  </code></pre>
  
  <p>The configuration would be stored for each server in app.config and  loaded into memory at startup. So each WCF operation would have its own WCF config (in terms of endpoints etc.) and it would send particular requests to different places according to that configuration.</p>
  
  <p>From what I have read of WCF I think this is possible. I don't know have enough experience to know if this is a standard WCF pattern that I am describing (if so please let me know). Otherwise, my main question is, how do I programatically configure each operation (as above) in WCF?</p>
  
  <p>Please let me know if I have not explained myself clearly.</p>
  
  <p>Thanks in advance for any help,
  Will</p>