Data Contract vs Message Contract in WCF - WCF Service Tutorial

If you are new to Data Contract and Message Contract. Please read my earlier blogs. Data Contract Message Contract

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.

Comments

Popular

C# 6.0 New Features

SharePoint Interview Questions and Answers

Calling ASP.Net WebMethod using jQuery AJAX

What is Cloud Computing - A guide for beginners