title: accessing WCF service through URL
body: <p>I have a WCF service ( Let's say WCFService1 ) is deployed on two remote machines. Since the same service is deployed on two different machines they have common interface and common methods exposed.</p>
  
  <p><strong>WCFService1 is deployed on Machine1 and Machine2.</strong></p>
  
  <p>To consume WCF service from client machine, I have created a client app:</p>
  
  <ol>
  <li><p>I have added a design time reference of WCF service (WCFService1 )( with the help of URL <a href="http://11.12.25.23/WCFService/Service1.svc" rel="nofollow noreferrer">http://11.12.25.23/WCFService/Service1.svc</a>).</p></li>
  <li><p>Now I can invoke the methods exposed in the service. Up until now its fine...</p></li>
  </ol>
  
  <p><strong>Now my question</strong> is If I have to update client at run time with same service hosted in different machine with different URL ( Let's say <a href="http://12.12.24.24/WCFService/Service1.svc" rel="nofollow noreferrer">http://12.12.24.24/WCFService/Service1.svc</a>), How can I do that?</p>
  
  <p>At present I am doing this:</p>
  
  <pre><code>BasicHttpBinding binding = new BasicHttpBinding();
  EndpointAddress address = new EndpointAddress("http://12.12.24.24/WCFService/Service1.svc");
  MyServiceClient serviceClient = new MyServiceClient(binding, address);
  </code></pre>
  
  <p>but whenever I use to invoke the method exposed in the service  I got binding mis match error.</p>