Wednesday, 11 April 2012

What is WCF ?


3. What is WCF ?
Ans:  Windows Communication Foundation ( Code named Indigo ) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application. An endpoint can be a client of a service that requests data from a service endpoint. The messages can be as simple as a single character or word sent as XML, or as complex as a stream of binary data.
WCF is a combined feature of Web Service, Remoting, MSMQ and COM+. WCF provides a common platform for all .NET communication.

Uses of  WCF

It is used to communicate between other applications which has been developed on other platforms and using other Technology.
For example, if  I have to transfer data from .net platform to other application which is running on  other OS (like Unix or Linux) and they are using other transfer protocol (like WAS, or TCP)
Then it is only possible to transfer data using WCF.
Advantages:

Here is no restriction of platform, transfer protocol of application while transferring the data between one application to other application.
Security is very high as compare to web service
WCF services provide better reliability and security in compared to ASMX web services.
In WCF, there is no need to make much change in code for implementing the security model and changing the binding. Small changes in the configuration will make your requirements.
WCF has integrated logging mechanism, changing the configuration file settings will provide this functionality. In other technology developer has to write the code.


What is the difference between web service and WCF ?
1. Web service use only HTTP protocol while transferring data from one application to other application.
But WCF supports more protocols for transporting messages than ASP.NET Web services. WCF supports sending messages by using HTTP, as well as the Transmission Control Protocol (TCP), named pipes, and Microsoft Message Queuing (MSMQ).

A WCF Service is composed of three components parts viz, 

1) Service Class - A WCF service class implements some service as a set of methods.
 
2) Host Environment - A Host environment can be a Console application or a Windows Service or a Windows Forms application or IIS as in case of the normal asmx web service in .NET. 

3) Endpoints - All communications with the WCF service will happen via the endpoints. The endpoint is composed of 3 parts (collectively called as ABC's of endpoint) as defines below: 

Address: The endpoints specify an Address that defines where the endpoint is hosted. It’s basically url. 

Ex: http://localhost:8090/MyFirstWcfService/Service.svc

Contract: The endpoints specify a Contract that defines which methods of the Service class will be accessible via the endpoint; each endpoint may expose a different set of methods.

Binding: The endpoints also define a binding that specifies how a client will communicate with the service and the address where the endpoint is hosted. Various components of the WCF are depicted in the figure below.

·                     "A" stands for Address: Where is the service?
·                     "B" stands for Binding: How can we talk to the service?
·                     "C" stands for Contract: What can the service do for us?

Major Components of WCF are :



Thanks For reading..!!


Default Programmer

No comments:

Post a Comment