Categories: Uncategorized

What Is Windows Communication Foundation (WCF)? | Introduction To WCF Service

Microsoft introduced WCF in 2006  along with .NET Framework 3.0.Windows Communication Foundation (WCF) is a next generation platform from Microsoft for service oriented architecture.

WCF Service Introduction

A service is a self-contained logical representation of a repeatable activity or function. Services can be combined with other software applications that together provide the complete functionality of a large software application.

Windows Communication Foundation, in short WCF, is a platform for developing distributed application services.

What is the use of WCF?

WCF is a cross platform programming model to create service.Hence WCF service can be consumed by a wide range of client applications such as .NET, Java or other technologies.It supports a variety of protocol, encoding, security, etc. It is more secure compared to Web Services.

The Windows Communication Foundation supports more protocols for transporting messages than the Web services, .Net remoting etc.

Web services only support sending messages via the Hypertext Transfer Protocol (HTTP). Remoting supports message transfer via TCP.

In WCF Service, Interoperability (communication) between applications is the key point of consideration. Implement the service functionality once and configure the same service in very easy steps to support message transfer over various different protocols including HTTP, TCP, Named Pipes, MSMQ, IPC and even some custom protocols.

.NET remoting demands the service and consumer be in .NET, which is a major constraint for distributed enterprise applications. Even though Webservices provide application/language interoperability, it also has protocol limitations.

Prior to WCF, we have to write different types of service component modules to work over different protocols such as Webservices for HTTP, Remoting for TCP etc.

WCF got introduced to addresses this issue.It is possible to write a WCF service logic once and configure the same service for any protocol/message transfer support.

That means WCF services can replace what all of its predecessors components (COM, COM+, Remoting, Webservices etc.) can do.

One other great advantage of WCF over other services is that WCF support of duplex communication, both half duplex, and full duplex. Webservices has only the capability of the simplex mode of communication.

Getting started With WCF Service For Beginners

What Is Simplex, Half Duplex and Full Duplex Communication?

Features of WCF Sevices

  1. Better interoperability and advanced protocol supports
  2. Improved reliability and security
  3. Better code reusability and highly configurable
  4. Multiple modes of message transports and Encodings
  5. Multiple Message Patterns
  6. Transaction supports
  7. Durable Messages and Queued Messages
  8. AJAX and REST Support
  9. Can be hosted in different sorts of application types such as Console application, Winforms application, ASP.NET web applications, Windows services etc.

ABC in WCF

WCF Service exposes end points which clients can access. Endpoint of the WCF services need to be configured properly.

Endpoint ABC is Address, Binding, and Contract.

A for Address: 

Address is the address of service, the URL where the service is hosted. We need to define the service address/URL inside the endpoint configuration.

B for Binding: 

Binding defines the communication type with the service.That is, how the service will communicate the outer world and the type of protocol which will be used for the communication.

C for Contract

Contract means the task performed by the service. The contract is the actual operation performed by the service. The contract name needs to be mentioned inside the endpoint.

Endpoint is configured as below,

<endpoint address=“ServiceUrl” binding=“BindingType” contract=“ActualContractName” />

Summary

So, that was a brief introduction to Basics of WCF services.I hope you have enjoyed this article Introduction To WCF Service. If you have any queries regarding Basics of WCF Services, feel free to comment below.

 

Rajeev

Recent Posts

OWIN Authentication in .NET Core

OWIN (Open Web Interface for .NET) is an interface between web servers and web applications…

1 year ago

Serializing and Deserializing JSON using Jsonconvertor in C#

JSON (JavaScript Object Notation) is a commonly used data exchange format that facilitates data exchange…

1 year ago

What is CAP Theorem? | What is Brewer’s Theorem?

The CAP theorem is also known as Brewer's theorem. What is CAP Theorem? CAP theorem…

1 year ago

SOLID -Basic Software Design Principles

Some of the Key factors that need to consider while architecting or designing a software…

1 year ago

What is Interface Segregation Principle (ISP) in SOLID Design Principles?

The Interface Segregation Principle (ISP) is one of the SOLID principles of object-oriented design. The…

1 year ago

What is Single Responsibility Principle (SRP) in SOLID Design Priciples?

The Single Responsibility Principle (SRP), also known as the Singularity Principle, is a software design…

1 year ago