There are basically four types of contracts:-
1) Service Contracts
It define what operation the client can perform using the Service. There are two types of Service contracts
a) ServiceContract – This attribute defines Interface.
b) OperationCOntract – This attribute defines method of Interface.
2) Data Contract
It defines the data types passed to and from the service. There are two types again:
a) DataContract – This attribute defines the data class.
b) DataMembers – This attribute defines the properties.
If DataMember attributes are not specified for a properties in the class, that property can’t be passed to-from web service.
It defines which type of error will be raised by the Service.
4) Message Contract
It allows service to interact directly with Message. Message Contract can be types or untyped.