title: What is the standardized way to pass complex types in WCF?
body: <p>I am a newbie in WCF, currently I am developing a TCP WCF service and I am not sure that  I understand passing parameters correctly or not so I recommend you to comment and give a standardized way.</p>
  
  <p>To get things clear I developed a small service for testing purpose that has single method and depends on an external .Net dll that exposes single class.
  The service contract code</p>
  
  <pre><code>    [ServiceContract]
      public  interface IMyService
      {
          [OperationContract]
          int Test1(actionType at, calculationType ct, action a);
          [OperationContract]
          int Test2(DataSeries s);
      }
  </code></pre>
  
  <p>Where  <code>actionType</code>,<code>calculationType</code>,<code>action</code> are enums declared inside the the external dll
  and <code>DataSeries</code> is a class declared inside the dll.</p>
  
  <p>The origianl defination for the <code>DataSeries</code> class in the dll is marked by <code>[Serializable]</code> only and no <code>[DataMember]</code> on its members.</p>
  
  <p>I am using the 3rd dll on the client and server side, my surprise was both applications working fine without putting <code>[DataContract]</code> on the DataSeries class and without using any of <code>[EnumMember]</code> inside enums, <code>[DataMember]</code> inside class.</p>
  
  <p>So what is going on?</p>
  
  <p>Another Experiment:</p>
  
  <p>Removing the 3rd party from the client side and using the service as it is
  I found that the vs2008 generates the enums and the <code>DataSeries</code> class and markes them with the proper attributes?
  like </p>
  
  <pre><code>    [System.CodeDom.Compiler.GeneratedCodeAttribute      ("System.Runtime.Serialization", "3.0.0.0")]
      [System.Runtime.Serialization.DataContractAttribute(Name="actionType",  Namespace="http://schemas.datacontract.org/2004/07/DBInterface")]
      public enum actionType : int {
  
          [System.Runtime.Serialization.EnumMemberAttribute()]
          All = 0,
  
          [System.Runtime.Serialization.EnumMemberAttribute()]
          Buy = 1,
  
          [System.Runtime.Serialization.EnumMemberAttribute()]
          Sell = 2,
      }
  </code></pre>