Definition of WCF
Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF we can build secure, reliable, transacted solutions that integrate across platforms.
WCF is a unified framework which provides :
1. NET Remoting 2.Distributed Transactions 3.Message Queues and 4.Web Services into a single service-oriented programming model for distributed computing.
WCF interoperate between WCF-based applications and any other processes that communicate via SOAP (Simple Object Access Protocol) messages.
Features of WCF
- Service Orientation
- Interoperability
- Multiple Message Patterns
- Service Metadata
- Data Contracts
- Security
- Multiple Transports and Encodings
- Reliable and Queued Messages
- Durable Messages
- Transactions
- AJAX and REST Support
- Extensibility
http://msdn.microsoft.com/en-us/library/ms733103.aspx
2. Service: A construct that exposes one or more endpoints, with each endpoint exposing one or more service operations.
3. Contracts: A contract is a agreement between two or more parties for common understanding and it is a is a platform-neutral and standard way of describing what the service does. In WCF, all services expose contracts.
Types of Contracts:
1) Operation Contract: An operation contract defines the parameters and return type of an operation.
[OperationContract] double Add(double i, double j);
2) Service Contract: Ties together multiple related operations contracts into a single functional unit.
[ServiceContract] //System.ServiceModel
public interface IMath
{
[OperationContract]
double Add(double i, double j);
[OperationContract]
double Sub(double i, double j);
[OperationContract]
Complex AddComplexNo(Complex i, Complex j);
[OperationContract]
Complex SubComplexNo(Complex i, Complex j);
}
3) Data Contract: The descriptions in metadata of the data types that a service uses.
// Use a data contract
[DataContract] //using System.Runtime.Serialization
public class Complex
{
private int real;
private int imaginary;
[DataMember]
public int Real { get; set; }
[DataMember]
public int Imaginary { get; set; }
}
The Best explanation for WCF on the net!!!
Pingback: WCF Step by Step Tutorial | Kỹ Thuật Lập Trình ASP.NET