Hello Friends, In this tutorial, I am going to tell you what is WCF and the advantages of using it. WCF is a framework that can be used to create a service-oriented application.

After completing this tutorial you will be able to understand:

  • What is WCF?
  • Components of WCF.
  • Advantages of WCF.
  • Scenarios where WCF can be used?

Introduction:

WCF stands for Windows Communication Foundation. WCF is a programming model for building distributed application and interoperable application. A distributed application is one where the part of the application runs on two or more computer nodes. WCF is used to create a service-oriented application that can be used by multiple clients. WCF can be used to send asynchronous messages from one end point to another end point. The end point can be a client such as a browser, an iPhone, a tablet of a service that requests data from a service endpoint. WCF is used to create a service that is accessible to Windows, Linux or any other devices.

WCF

Scenarios where WCF can be used?

  • A Secured service that needs to perform some business transaction.
  • A Service that delivered some data to other application such as whether report.
  • A Service that exchanges data between two or more peoples for communication.
  • A service that needs to used by the browser as well as Mobile devices.

Fundamental Terms of WCF.

EndPoint:

When we create a WCF Service it exposes a collection of EndPoints. This EndPoint is responsible for communication with Clients that is consuming the service. The EndPoint is the address which is used to send or received the message.

The EndPoint has the following major component:

1- Address:

The address is the location where your service is hosted as URL. This URL is used by the client to build communication between service and client.  An example of Address is

2- Binding:

The binding specifies the protocol that will use to build communication with the specified end point.

3- Contract:

It specifies the functionality that the endpoint is going to expose. The contract contains the name of the Interface.

Below is the example of EndPoint:

Message:

A message is a communication unit which is sent and received from the client. It contains the body, headers and many other several parts.

Channel:

If your Service was the human body, channels would be the sensory nerves of your Service. Sensory nerves carry messages from receptors in your body to your brain. Sensory messages pass through multiple nerves on the way to the brain.

Channels act as sensory nerves between the service and clients. It is used to carry messages between service and clients. There are two types of channel.

1- Transport Channel:

Transport Channel handles the communication over the wire. It transfers messages between service and client using Transport protocol. It supports protocols like TCP, HTTP, MCMQ.

2- Protocol Channel:

It is used to implement security to implement security, transaction and reliable messaging.

Hosting:

It specifies the hosting such as Self Hosting, IIS hosting, WAS Hosting and Windows Service Hosting.

WCF Client:

It is the client application which is used to expose the service operations in form of method.

MetaData:

The metadata can be used to automatically generate and configure clients for accessing WCF services.  We can enable the ServiceMetadata node inside the serviceBehavior node of the service configuration file.

Advantages of WCF Service:

  • The main feature of WCF is interoperability
  • It provides better security as compared to web service
  • No need to make a big change for security.
  • It is language independent.
  • It is Location independent.
  • WCF can control Concurrency issue.

Conclusion:

Hope you understand this important tutorial about WCF in .NET and what is the advantages of it.  I will appreciate your feedback, comments, and suggestions.

View More:

Thank You.

 

Explore post tags

16 Comments

  • When I originally commented I clicked the -Notify me when new comments are added- checkbox and now every time a comment is added I get four emails with the same comment. Is there any method you’ll be able to remove me from that service? Thanks!

  • I intended to write you that very little remark to thank you very much over again on your nice guidelines you have contributed on this site. It has been simply wonderfully open-handed with you to allow unhampered what many people could possibly have marketed as an e book in order to make some cash on their own, even more so considering the fact that you might well have done it if you desired. Those tips likewise worked like a good way to know that many people have a similar interest just as my personal own to understand a whole lot more when considering this matter. Certainly there are a lot more enjoyable opportunities ahead for individuals who browse through your website.

  • I in addition to my guys appeared to be examining the great points from your web site and then quickly I got a horrible feeling I never thanked the web site owner for those strategies. All the ladies were definitely as a result excited to see them and already have quite simply been enjoying those things. Appreciation for being so accommodating and for obtaining such exceptional guides most people are really desirous to learn about. My personal honest apologies for not saying thanks to you earlier.

  • I just want to mention I’m beginner to blogging and site-building and definitely enjoyed this blog. Likely I’m planning to bookmark your blog . You certainly have incredible articles and reviews. Kudos for sharing with us your website page.