What is different between Message Contract and Data Contract in WCF?
Dinesh Chand
Data contracts only provide access to SOAP body(limited to changing the Names and Order of contracts) where as MessageContract provides full access to SOAP XML(both request and response). We can send customized data in SOAP header using using MessageHeader attribute and also customize the SOAP body using MessageBodyMember atttribute. Primary difference is degree of access it provides to customize SOAP request and response.
Data Contracts: A data contract is a formal agreement between a service and a client that abstractly describes the data to be exchanged. Data contract can be explicit or implicit. Simple type such as int, string etc has an implicit data contract. User defined object are explicit or Complex type, for which you have to define a Data contract using [DataContract] and [DataMember] attribute. A data contract can be defined as follows: