Blankman: Since a WCF service can return any user defined class, why use a DataContract and CompositeType class?
I can return something like:
[OperationContract] MyUserCollection GetUsers();
What am I missing?
Guy Starbuck: The DataContract is just a formal definition of a type that can be understood on both sides of the service boundary.
If you return, as in your example, a "MyUserCollection" object, the consumers of your service will need to reference the innards of your service/system, which is a violation of the SOA tenet of explicit boundaries. By using a DataContract, you are publishing the structure of your return types in a loosely-coupled way.
[http://stackoverflow.com/questions/303013/whats-the-point-of-a-datacontract-in-wcf]