Basic concept of WCF


WCF(Windows Communication Foundation) is most recent evolution in this field. First question comes in mind is that why this WCF is introduced instead of promoting Web services and remoting? Simple answer is that drawbacks in these two are covered in WCF. In Remoting we must have both client and remoting component should be developed in dotnet and we can only use HTTP or TCP protocol. Web services are platform independent and protocol used for web services is SOAP over HTTP. In WCF we have support of almost all protocols , WCF service can be hosted on self hosting application,IIS and WAS(windows application service). WCF also supports transaction management . WCF is used to implement Service oriented architecture which is widely required in current trend as application required to communicate with other applications. Service oriented architecture means collection of services communicated with each other with the help of messages.

WCF services can have n number of end points. end points are the pointers with the help of which client knows where service is located(Address) and how to access that service(binding) and what operations are available for accessing this service(Service contract). This is ABC’s of WCF(Address,Binding and Contract) . Client only knows end point and does not know about the service this is loosely coupled architecture in which if we change the service we need not have to change the client as client accesses the service only with the help of end point.

Building WCF application there are two steps

1) Build Service layer: In this we need to define various contracts

Service Contract : It will define which operation to be available for invoking when service receive request from client

Data Contract : define the structure of data to the transferred from Client to service

Message Contract : enable us to control the headers that
appear in the message and how the messages are structured.

2) Create Proxies : Proxy classes to be created from service metadata.There are various methods to create proxies e.g using svcutil command line utility, from Visual Studio, by defining manually and dynamical proxy creation

3) Create Client application : Client application need to be created in order to consume the services This step also include creating the configuration files.

2 thoughts on “Basic concept of WCF

  1. Hi,
    Thats good article.. and were coming to point, WCF is not implemented for the drawbacks of Remoting & Webservices.. Remoting & Webservices are specific to their Technology support only.
    I think u got my point.. Those are not drawbacks..
    thanks..

Leave a comment