Friday, December 27, 2013

WCF: Contracts an Introduction

In WCF all services expose contracts. Now a question arises what is a contract?
 
Contract is a platform neutral and standard way of describing what the service does. There are four types of contracts,
  • Service Contracts
  • Data Contracts
  • Fault Contracts
  • Message Contracts
Here we will try to define and use of each contract type.
 
Service Contracts describe which operations the client can perform on the service.
 
Data Contracts define which data types are passed to and from the service. WCF defines implicit contracts for built in types int and string, but we can easily define explicit  opt-in data contracts for custom types.
 
Fault Contracts define which errors are raised by the service and how the service handles and propagates errors to its clients.
 
Message Contracts allow services to interact directly with messages.
 
We will look into each of these Contracts in later blogs.

No comments:

Configuration for CRM Plugins

CRM plugins are always great feature where we can automate many functionality which we cannot automate from user interface. But almost eve...