Question - How many types of contract WCF define?
Answer -
There are four types of contracts that WCF define:
Service Contracts
The ServiceContract attribute maps a CLR interface (or inferred interface, as you will see later on) to a technology-neutral service contract. The ServiceContract attribute exposes a CLR interface (or a class) as a WCF contract, independently of that type's visibility.
Data Contracts
The descriptions in metadata of the data type that a service uses. This enables others to interoperate with the service. The data types can be used in any part of a message, for example, as parameters or return types. If the service is using only simple types, there is no need to use data contracts explicitly.
Fault Contracts
Can be associated with a service operation to denote errors that can be returned to the caller.
Message Contracts
Describes the format of a message. For example, it declares whether message elements should go in headers versus the body, what level of security should be applied to what elements of the message, and so on.