title: web service can't serialize an interface
body: <p>I have an interface like so:</p>
  
  <pre><code>public interface IDocument : ISerializable
  {
      Boolean HasBeenUploaded { get; set; }
      void ISerializable.GetObjectData(SerializationInfo, StreamingContext) { }
  }
  </code></pre>
  
  <p>There are three documents that inherit from this, all of which serialize just fine. But when creating a simple web service, that does nothing, where they can be uploaded to... </p>
  
  <pre><code>public class DCService : System.Web.Services.WebService
  {
      [WebMethod]
      public Boolean ReceiveDocument(IDocument document)
      {
          DBIO io = new DBIO();
  
          return io.InsertIntoDB(document); // does nothing; just returns true
      }
  }
  </code></pre>
  
  <p>I get this when trying to run it: "Cannot serialize interface IDocument"</p>
  
  <p>I'm not quite sure why this would be a problem. I know that <a href="https://stackoverflow.com/questions/360208/enforcing-serializable-from-an-interface-without-forcing-classes-to-custom-serial">some people</a> have had trouble because they didn't want to force subclasses to implement custom serialization but I do, and up to this point it has been successful.</p>
  
  <p>edit> If I create individual webmethods that accept the objects that implement the interface, it works fine, but that weakens the contract between the client/server (and undermines the purpose of having the interface in the first place)</p>