Tag Archives: Data Contacts

Understanding Data Contract in WCF

WCF Data Contract In Windows Communication Foundation, Data Contract is an agreement between parties (i.e. a service and a client) that describes what type of data will be exchanged between them? We can control the contents (i.e. Payload data or message body) of a SOAP message using Data Contract. In more simple words, we can say […]

Using WCF Data Contract Known Types by Example

Data Contract describes the type of data that will be sent or received between a service and a client. But in certain scenarios, sent or received data is not known between the the communicating parties. For example, a service sending data back to client is not the actual data contract but a derived type of […]

DataContract Vs MessageContract in WCF

Data Contract in WCF is an agreement between parties (i.e. a service and a client) that describes what type of data will be exchanged between them? On the other hand, Message Contract describes the structure of SOAP messagethatis passed between parties (i.e. a service and a client). Using Data Contract, we actually control the contents […]

WCF Service – What is a KnownType?

In Windows Communication Foundation, a KnownType is the acceptable derived class for a given Data Contract. Using WCF Data Contract Known Types by Example For the purpose of understanding in this WCF Tutorial, lets take an example. Consider the following Data Contract classes having inheritance relationship as follows:    [DataContract]    public class UserAccount {} […]