DataContract can help us design the data types used in a WCF service. However, this only covers the data members (variables and parameters used in operation) serialized in the underlying SOAP message. Sometimes we also need to control the structure and format of the entire SOAP message.
WCF introduces a
MessageContract concept, which helps service developers to model the structure and format of the entire message of a given service operation. Actually, we can take
MessageContract type as a special
DataContract type, which is marked by the
MessageContractAttribute. This recipe will show you how we can define a typical
MessageContract for our WCF service operation to control the format of the underlying ...