title: Programmatically create endpoints in .NET WCF service
body: <p>I have a class that is designed to work with a web service. For now, I've written it to query <a href="http://www.nanonull.com/TimeService/TimeService.asmx">http://www.nanonull.com/TimeService/TimeService.asmx</a>. </p>
  
  <p>The class is going to be used by a legacy app that uses VBScript, so it's going to be instantiated using Namespace.ClassName conventions. </p>
  
  <p>I'm having trouble writing the code to get bindings and endpoints working with my class, because I won't be able to use a config file. The samples that I have seen discuss using SvcUtil.exe but I am unclear how to do this if the web service is external. </p>
  
  <p>Can anyone point me in the right direction? This is what I have so far, and the compiler is crashing on IMyService:</p>
  
  <pre><code> var binding = new System.ServiceModel.BasicHttpBinding();
          var endpoint = new EndpointAddress("http://www.nanonull.com/TimeService/TimeService.asmx");
  
          var factory = new ChannelFactory&lt;IMyService&gt;(binding, endpoint);
  
          var channel = factory.CreateChannel(); 
  
  
          HelloWorld = channel.getCityTime("London");
  </code></pre>