title: In WCF, is there a way to omit / hide a ServiceOperation or a DataMember from the WSDL?
body: <p>I have an existing WCF service. At some point, sometimes an <code>[OperationContract]</code> or a <code>[DataMember]</code> in a data contract becomes <code>[Obsolete]</code>.  I don't want to remove the method, for back-wards compatibility reasons. Another example is sometimes I have an Enum, and want to <code>[Obsolete]</code> one of the choices, but I can't completely remove it because items already exist in the system / database that contain that value.</p>
  
  <p>Anyway, is there a way to omit certain items from the generated WDSL? For example:</p>
  
  <pre><code>[ServiceContract]
  public interface IMyService
  {
      [OperationContract]
      string SomeMethod(string x);  // I do want this in the WSDL
  
      [Obsolete]
      [OperationContract]
      string OldMethod(string x); // I do NOT want this in the WSDL, but I do want it to still work / be callable if an older system tries to call it.
  }
  </code></pre>