title: An error occurred while receiving the HTTP response
body: <p>I have a wcf web application that is hosting the services on a server. I'm creating the client(api) to read these services.</p>
  
  <p>I have added tracing to my service side using:</p>
  
  <pre><code>&lt;system.diagnostics&gt;
      &lt;sources&gt;
        &lt;source name="System.ServiceModel.MessageLogging"&gt;
          &lt;listeners&gt;
            &lt;add name="messages"
            type="System.Diagnostics.XmlWriterTraceListener"
            initializeData="bin\messages.svclog" /&gt;
          &lt;/listeners&gt;
        &lt;/source&gt;
      &lt;/sources&gt;
    &lt;/system.diagnostics&gt;
  </code></pre>
  
  <p>The .svclog file does not show any errors, so I'm guessing it has to do with the de-serialization of the objects on the client side. How do I see if this is the case?</p>
  
  <p>Help in ways to trace the issue would be great.</p>
  
  <p>I had to add to the SETters the if null due to an error that the private members were null. Ever since then, I have been getting the http errors.</p>
  
  <p>Example of the DTO:</p>
  
  <pre><code>[DataContract]
  public class PersonDTO 
  {              
      private CUSTOMType&lt;string&gt; givenNameField ;    
      private CUSTOMType&lt;string&gt; middleNameField ;    
      private CUSTOMType&lt;string&gt; familyNameField ;         
  
      [DataMember]
      public string GivenName
      {
          get
          {
              return this.givenNameField.Value;
          }
          set
          {
              if (this.givenNameField == null)
                  this.givenNameField = new CUSTOMType&lt;string&gt;(); 
              this.givenNameField.Value = value;
          }
      }
  
      [DataMember]
      public string MiddleName
      {
          get
          {
              return this.middleNameField.Value;
          }
          set
          {
              if (this.middleNameField == null)
                  this.middleNameField = new CUSTOMType&lt;string&gt;(); 
              this.middleNameField.Value = value;
          }
      }
  
      [DataMember]
      public string FamilyName
      {
          get
          {
              return this.familyNameField.Value;
          }
          set
          {
              if (this.familyNameField == null)
                  this.familyNameField = new CUSTOMType&lt;string&gt;(); 
              this.familyNameField.Value = value;
          }
      }
  }
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Originally I had two objects: Business and DTO. The only difference was that the DTO was just straight C# datatypes, where the Business layer has logic and my CUSTOMType. This worked with no problem. Now I saw this as duplication and was trying to combined the two. It might be possible that the binary serialization process just doesn't like my custom types. </p>
  
  <p>The constructor at one point, did have the init of the private members. The service throw errors that the private members were null. That is why I changed to to the SETTERS.</p>