Data Contract has very less control over SOAP message, while Message Contract has full control.
Data Contract vs Message Contract
- Data Contract is used to define the structure of data which will be exchanged between client and server.
- On another side, Message Contract is used to control the SOAP message. For example, if you have developed a service which requires Authentication, in this case, user credentials should be sent in SOAP message header and here the role of Message Contract starts.
Related blogs to WCF Service-
- Introduction to WCF
- ABC of WCF
- Basics of WCF Architecture
- WCF vs Web Service
- What is XML serialization?
- WCF Binding
- Create first WCF application
- Fault Contract in
- WCF Data Contract vs Message Contract
- Message Contract
- Data Contract Serialization and De-Serialization
- Data Contract in WCF
- Operation Contract in WCF
- Service Contract in WCF
- How to host a WCF service in IIS?
- WAS Hosting in WCF
- Self Hosting in WCF
- How to create WCF RESTful Service.