title: Getting an error while calling WCF Service
body: <p>I have a simple WCF service running on a server machine.</p>
  
  <p>Unit Test calling the service:</p>
  
  <pre><code>[TestMethod]
  public void CreateLabelManagerTestMethod()
  {
      // Arrange
      var client = new PrintServiceClient();
  
      // Act
      var manager = client.CreateLabelManager() as ILabelManager;
  
     // Assert
     Assert.IsNotNull(manager);
  }
  </code></pre>
  
  <p>I am getting an exception:</p>
  
  <blockquote>
    <p>{"An error occurred while receiving the HTTP response to
    [myservice.svc]. This could be due to the service endpoint binding not
    using the HTTP protocol. This could also be due to an HTTP request
    context being aborted by the server (possibly due to the service
    shutting down). See server logs for more details."}</p>
  </blockquote>
  
  <pre><code>[ServiceContract]
  public interface IPrintService
  {
      [OperationContract]
      ILabelManager CreateLabelManager();
  }
  
  public class PrintService : IPrintService
  {
      public ILabelManager CreateLabelManager()
      {
          return new LabelManager();
      }
  }
  
  [DataContract]
  public class LabelManager : ILabelManager
  {        
      public ILabel CreateLabel(string templateFullFileName)
      {
          return new Label(templateFullFileName);
      }
  }
  
  [DataContract]
  class Label : ILabel, IEnumerable&lt;IField&gt;, IDisposable
  {
      public Label(string templateFullFileName)
      {
          this.TemplateFullFileName = templateFullFileName;          
      } 
      [DataMember]
      public string TemplateFullFileName { get; set;} //add set for serialization
  }
  </code></pre>