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.

Share on Google Plus

Please write your comment below. Share this blog on Social media.


Post a Comment

Dear Readers, Please post your valuable feedback in the comment section if you like this blog or if you have any suggestions. I would love to hear the same from you. Thanks