Loading

Windows Communication Foundation (WCF)

What is WCF?. The Complete Windows Communication Foundation (WCF) Developer Course 2023 [Videos].

WCF stands for Windows Communication Foundation. It is basically used to create a distributed and interoperable Application. WCF Applications came into the picture in .Net 3.0 Framework. This is a framework, which is used for creating Service oriented Applications. You can send the data asynchronously from one end point to another. I think you all know about Web Service and are thinking, if we already have Web Services and accessing on a remote basis then why did WCF come into picture?


There are so many reasons for it but now I am giving you an answer in two words- one is protocol and the other is hosting. WCF was released for the first time in 2006 as a part of the .NET framework with Windows Vista, and then got updated several times. WCF 4.5 is the most recent version that is now widely used.

A WCF application consists of three components −

  • WCF service,
  • WCF service host, and
  • WCF service client.

WCF platform is also known as the Service Model.

Fundamental Concepts of WCF

Message

This is a communication unit that comprises of several parts apart from the body. Message instances are sent as well as received for all types of communication between the client and the service.

Endpoint

It defines the address where a message is to be sent or received. It also specifies the communication mechanism to describe how the messages will be sent along with defining the set of messages. A structure of an endpoint comprises of the following parts −

Address

Address specifies the exact location to receive the messages and is specified as a Uniform Resource Identifier (URI). It is expressed as scheme://domain[:port]/[path]. Take a look at the address mentioned below −

net.tcp://localhost:9000/ServiceA

Here, net.tcp is the scheme for the TCP protocol. The domain is localhost which can be the name of a machine or a web domain, and the path is ServiceA.

Binding

It defines the way an endpoint communicates. It comprises of some binding elements that make the infrastructure for communication. For example, a binding states the protocols used for transport like TCP, HTTP, etc., the format of message encoding, and the protocols related to security as well as reliability.

Contracts

It is a collection of operations that specifies what functionality the endpoint exposes to the client. It generally consists of an interface name.

Hosting

Hosting from the viewpoint of WCF refers to the WCF service hosting which can be done through many available options like self-hosting, IIS hosting, and WAS hosting.

Metadata

This is a significant concept of WCF, as it facilitates easy interaction between a client application and a WCF service. Normally, metadata for a WCF service is generated automatically when enabled, and this is done by inspection of service and its endpoints.

WCF Client

A client application that gets created for exposing the service operations in the form of methods is known as a WCF client. This can be hosted by any application, even the one that does service hosting.

Channel

Channel is a medium through which a client communicates with a service. Different types of channels get stacked and are known as Channel Stacks.

SOAP

Although termed as Simple Object Access Protocol, SOAP is not a transport protocol; instead it is an XML document comprising of a header and body section.

Advantages of WCF

  • It is interoperable with respect to other services. This is in sharp contrast to .NET Remoting in which both the client and the service must have .Net.

  • WCF services offer enhanced reliability as well as security in comparison to ASMX (Active Server Methods) web services.

  • Implementing the security model and binding change in WCF do not require a major change in coding. Just a few configuration changes is required to meet the constraints.

  • WCF has built-in logging mechanism whereas in other technologies, it is essential to do the requisite coding.

  • WCF has integrated AJAX and support for JSON (JavaScript object notation).

  • It offers scalability and support for up-coming web service standards.

  • It has a default security mechanism which is extremely robust.

See All

Comments (737 Comments)

Submit Your Comment

See All Posts

Related Posts

Windows Communication Foundation (WCF) / Blog

What is WCF?

WCF stands for Windows Communication Foundation. It is basically used to create a distributed and interoperable Application. WCF Applications came into the picture in .Net 3.0 Framework. This is a framework, which is used for creating Service oriented Applications. You can send the data asynchronously from one end point to another. I think you all know about Web Service and are thinking, if we already have Web Services and accessing on a remote basis then why did WCF come into picture?
22-Apr-2022 /50 /737

Windows Communication Foundation (WCF) / Blog

Major differences that exist between WCF and a Web service.

WCF (Windows Communication Foundation): WCF, as the name suggests, is a unified .NET framework that is used to develop service-oriented applications. It allows you to develop applications that can communicate using different communication mechanisms.
22-Apr-2022 /50 /737

Windows Communication Foundation (WCF) / Blog

Difference between WCF and Web API.

WCF is used to create a distributed and interoperable Applications. It provides a framework which is used for building service-oriented-connected applications for the transmission of the data as an asynchronous, from one service-point to other service-point. Previously known as Indigo and is a framework for building, configuring, and deploying network-distributed services.
22-Apr-2022 /50 /737