Thursday, 15 September 2011

Contracts In WCF?

Contract is a platform-neutral and it describes what the service does. Mainly there are four types of contracts available in WCF.

  1. Service Contract
  2. Data Contract
  3. Message Contract
  4. Fault contract

1. Service Contract:

 Service contracts describe the operation that service can provide.

2. Data Contract:

      Data contract describes the custom data type which is exposed to the client.

3. Message Contract:

The SOAP message format is provided by the WCF runtime for communication between Client and service. If it is not meeting your requirements then we can create our own message format. This can be achieved by using Message Contract attribute.

4. Fault Contract:

   The Fault Contract provides documented view for error occurred in the service to client. This helps us to easy identity, what error has occurred.

No comments:

Post a Comment

Please Give Your Valuable Comments on this Topic