Introduction
In this post we will learn what is WCF . When it comes in scope and why do we need this if we already have a web service concept.
What is WCF
Windows Communication Foundation (WCF) is a Microsoft framework for building service-oriented applications.It is basically used to create a distributed and interoperable Applications. WCF concepts comes in fron with .Net framework 3.0 and makes a great impact on Web service field. WCF is great evolution in Service environment by Microsoft.
The best thing in WCF in comparison to WebService is it allows you to create "services" without any disruption that whether it's a Windows service or a Web service, and do not cares about which type of protocols are used for communication or how the data is serialized.
Advantages -
Why WCF
What is WCF
Windows Communication Foundation (WCF) is a Microsoft framework for building service-oriented applications.It is basically used to create a distributed and interoperable Applications. WCF concepts comes in fron with .Net framework 3.0 and makes a great impact on Web service field. WCF is great evolution in Service environment by Microsoft.
The best thing in WCF in comparison to WebService is it allows you to create "services" without any disruption that whether it's a Windows service or a Web service, and do not cares about which type of protocols are used for communication or how the data is serialized.
Advantages -
An application can connect with other application but it doesn't make a difference that which platform that application was build.
It can run on any Machine and consumed from any client whether it is from Java or other platform, there is no restriction for this service .
It uses service contract, Data contract and Bindings for communication.
It can run on any Machine and consumed from any client whether it is from Java or other platform, there is no restriction for this service .
It uses service contract, Data contract and Bindings for communication.
Why WCF
Why do we need WCF , this is the first question comes in our mind when we thinking about services.
If you are working with service then you have many clients , suppose your one client wants to send data over the network using HTTP protocol and want reply in XML format, so we create a Web Service in that manner.
The other client wants to use a WebService over the network using TCP protocol and replying in binary format than we need to create another Service with TCP protocol communication.
In the above scenario if we use web service then we have to create two services for both clients and so on for other clients. Here comes the WCF which is eliminate this problem and provide a solution by self. By using a single WCF service we can communicate any type of protocol and don't need to create another service. In the end point attribute we define the protocol for our service.
Basics Of WCF
The four main fundamental concepts of WCF is
- Message
- End point
- Hosting
- SOAP.
Message:
It is an communication unit. With data contracts we have very limited control over the SOAP XML request and response message that are generated. WCF use Message contracts for full control over the generated xml SOAP message.
The transmission of data between client and server is done by envelope which we can see in any SOAP request. The envelope or you can say that Mesasge has two sections
Header and Body.
We can include custom data in SOAP Header like user name for each request , credentials, License keys etc.
End Points
End points is the most crucial part of the WCF application .It describe where a user receive or send message and how message will send or receive.
End points known for three thing which is A, B and C.
- Address (Where)
- Binding (How)
- Contract (What)
Address is the service address where the service is hosted. It gives the URL of the service.
Binding describes the mechanism by which user can communicate with Web service.
Contract is the functionality and operations provided by the service. Contract specifies which functionality and operations need to be displayed to the client.
Hosting
After the creation of WCF service hosting comes in light. Hosting makes WCF differ from Web service . WCF supports many hosting
- IIS Hosting
- WAS Hosting
- Self Hosting
0 comments:
Post a Comment