Contract is an agreement between 2 or more parties. It defines how client should communicate with your service. Technically it describes parameters and return values for a method.
Contract is a platform neutral and standard way of describing what a service does
There are 4 types of contracts.
1.Service contract.
2.Message contract.
3.Data contract.
4.Fault contracts.
Service contract:It provides list of operations provided by a service.A client can make use of operations with the help of service contract.
End point provides implementation regarding service contract. each operation in service contract must be defined as operation contract.
Message Contract: Default soap message will be provided by wcf run time for communication between client and service. If it is not meeting your requirement then we can create our own message format.
Operation Contract: It describes which methods should be exposed as a service by using the service.
Data Contract: It defines which types of complex data will be exposed between the client and service. they determine which parameters to be serialized. wcf implicit contracts for built in types such as int and string but we can easily define explicit operation contract for custom types.
DataContract --Attribute used to define the class
DataMember -- Attribute used to define properties
WCF uses xml, xsd, soap and binary formats as transmission languages. you can choose any one of them.
Fault Contracts: define which errors to be raised by the service and how the service handles and propagate errors to clients.
Contract is a platform neutral and standard way of describing what a service does
There are 4 types of contracts.
1.Service contract.
2.Message contract.
3.Data contract.
4.Fault contracts.
Service contract:It provides list of operations provided by a service.A client can make use of operations with the help of service contract.
End point provides implementation regarding service contract. each operation in service contract must be defined as operation contract.
Message Contract: Default soap message will be provided by wcf run time for communication between client and service. If it is not meeting your requirement then we can create our own message format.
Operation Contract: It describes which methods should be exposed as a service by using the service.
Data Contract: It defines which types of complex data will be exposed between the client and service. they determine which parameters to be serialized. wcf implicit contracts for built in types such as int and string but we can easily define explicit operation contract for custom types.
DataContract --Attribute used to define the class
DataMember -- Attribute used to define properties
WCF uses xml, xsd, soap and binary formats as transmission languages. you can choose any one of them.
Fault Contracts: define which errors to be raised by the service and how the service handles and propagate errors to clients.
No comments:
Post a Comment