Step towards Windows Communication Foundation Part-2
In previous article we have seen what is WCF? How it’s came in programming all the things. In this article we will see some basic of Windows Communication Foundation .
Windows Communication Foundation:
WCF is nothing but the distributed programming between .Net to any User with their own proprietary methods. For .Net User today to develop a service WCF is the only preferred way. In general you can say
WCF=.Net Remoting + Web Service + New Standard.
WCF Simple Term:
1. One stop-shop for service.
2. Consistent object model.
3. Great feature.
Next Generation of ASMX is WCF:
The unified framework for rapidly building service-oriented application. WCF is provided as a framework with it’s own runtime & libraries. .Net component is executed using CLR but the request-response will be handled by the WCF framework. It is built on the top of .Net framework.
How WCF provides this communication environment?:
Every WCF application that we develop includes following structure/components using which it provides it’s reach communication model.
This is a structure which provide info about service(program). Endpoint includes three things and they are easily referred as ‘ABC’.
A network address where the endpoint resides.
Specify how the endpoint communicates with the world. As well defines the following three things.
1) Transport (eg. Http , Tcp)
2) Encoding (Text , Binary)
3) Security Option(SSL, Message Security)
Specify what Endpoint communicates.
1) Message exchange pattern (One-way, Duplex).
2) Service Operation.
3) Service Behavior (Exchange Meta-Data, Impersonate Authorization).
2) Service Contract:
This is most important attribute which adds all WCF functionality to our component so that it can be exposed as a contract in Endpoint.
3) Operation Contract:
Again an attribute which makes an operation exposed in our service . This attribute is written to method of [ServiceContract] Class.
If we do not write operation contract then those methods are accessible within .Net class only not to outside world.
4) Data Contract:
In operationcontract or WCF enabled methods if we are using any complex types to represent either Data/Action then we must declare them as DataContract.
Public void Add(Job j);
In this article we have seen some basic step towards Windows Communication Foundation. In second article we will see how to create our own service using WCF? How to host this service? How to consume the service created using WCF?