Windows Communication Foundation (WCF) is a
technology for developing applications based on service-oriented architecture (SOA).
WCF offers unified model for developing services accessible to all user in their
native communication options. it combines almost all .net and other technology
supports.
Before creating the WCF service we must know the basic WCF concepts and these
concepts are WCF ABCs.
There are many terms and concepts around WCF, such as address, binding,
contract, endpoint, behavior, hosting, and channels. Understanding these terms
is very helpful when using WCF.
Address
The WCF Address is a specific location for a
service. here we mention our service address using which clients can communicate
with our service.
Binding
In this section we specify the type of
communication that is required between client and service for providing
functionality and access. This is where WCF different compared to web service
and other services. web service provides only single binding option and that is
HTTP.wcf service provides multiple binding option for a single .net component or
service.
Contracts
A WCF contract is a set of specifications that
define the interfaces of a WCF service. A WCF service communicates with other
applications according to its contracts. There are several types of WCF
contracts, such as Service Contract, Operation Contract, Data Contract, Message
Contract, and Fault Contract.
Service Contract
Service contract is wcf attribute which specifies the type to be consumed as part of service communication. we can use this attribute for almost all user defined types.
// Employee ServiceContract
[ServiceContract]
public interface IEmployeeService
{
// Define the OperationContact here….
}
Operation Contract
This attribute make our method accessible from the service contract type.
Operation contract should be specify for method which we want to exposed too
user.
A service contract should have at least one operation contract.
// Employee ServiceContract
[ServiceContract]
public interface IEmployeeService
{
// Define the GetEmployeeFullName OperationContract here….
[OperationContract]
String GetEmployeeFullName(int employeetId);

Anil KumarPosted Jul 9, 2013, 11:07 PM
Good Start....