title: System.ServiceModel.CommunicationException error while trying to pass an IEnumerable object
body: <p>I am making a small WCF client server application where users can send messages and check their inbox. I have a custom <code>Message</code> class which has the fields: <code>message_to</code>, <code>message_from</code>, <code>message_text</code>, <code>message_time</code>. </p>
  
  <p>Since I would need to display the messages on the client UI, I am returning an IEnumerable <code>Messages</code> object to the client. I designated the Message class as a <code>DataContract</code> and the fields <code>message_from</code>, <code>message_text</code>, <code>message_time</code> as a <code>DataMember</code>.</p>
  
  <p>When trying to access the messages from the client, I get the following error:</p>
  
  <pre><code>System.ServiceModel.CommunicationException: An error occurred while receiving the HTTP response to http://localhost:9002/vService/CheckService. 
  </code></pre>
  
  <p><a href="http://pastebin.com/zFR82CNW" rel="nofollow">Here is the paste of the complete exception.</a></p>
  
  <p>The service proxy on the client side is</p>
  
  <pre><code>[ServiceContract]
  public interface ICheckService
  {
      [OperationContract]
      IEnumerable&lt;Message&gt; CheckInbox(string user);
  </code></pre>
  
  <p>I have enabled logging and tracing, but nothing turns up in the logs. Here is the <a href="http://pastebin.com/msw00nx3" rel="nofollow">web.config</a></p>
  
  <p>Message class:</p>
  
  <pre><code>[DataContract]
  public class Message
  {
      public int Message_Id;
      [DataMember]        
      public string Message_from;
      [DataMember]
      public DateTime Message_time;
      public string Message_to;
      [DataMember]
      public string Message_text;
  
      public Message()
      {
      }
  }
  </code></pre>
  
  <p>The generated proxy class, <a href="http://pastebin.com/cj1Wrsq3" rel="nofollow">reference.cs</a></p>
  
  <p>A lot of people on SO have received this error and unfortunately none of their solutions worked for me. I feel I am still missing something. </p>