title: Serialization of struct objects by webservices
body: <p>I have 'extended' the System.DateTime struct by adding some essential fields to it. Ideally I'd like to be able to deliver this object via a webservice to a winforms client.</p>
  
  <p>I've marked the stuct type as <code>[Serializable]</code> and it also implments <code>ISerializable</code>, however if I inspect the XML being delivered by the webservice it simply contains an empty tag for the object. </p>
  
  <p>Putting breakpoints all over the place has lead me to believe that when the object gets de-hydrated the ISerializable method <code>void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)</code> never appears to get called.</p>
  
  <p>There are various reasons why I'd prefer to keep this as a struct, but will convert it to a class if necessary.</p>
  
  <p>Does anyone know why GetObjectData is being ignored by the .net framework while it is preparing the data for the webservice response? The struct which I am working with contains a DateTime member and a few booleans.</p>
  
  <p><strong>please note, this is .net 2.0!</strong></p>
  
  <p>Cheers</p>