ABC of WCF ( Address, Binding, and Contract of WCF )

Introduction

WCF ; Windows Communication Foundation, the name already describes what it is. Let me clarify it once again. WCF is an advance technology of Microsoft that enables user to use it in a network distributed manner. In layman's language lets say you have written some bunch of code and you want to use it from various applications at a single time, then WCF gives you this freedom.

Before going into details we have to know the fundamentals of WCF. The Microsoft .NET framework provides you the template for developing the WCF application.

Behind The Scene

In this article I will give a brief idea about the ABC of WCF.

A ( Address ) : A stands for address, this is the url ( address ) through which the WCF service can be accessible. You can say it as a url or address. The basic format of an WCF service address is below;

[Protocol]://[Machine Name/Domain Name] : [Port]/[Service Name]

** Here the [Port] number is optional.

There are various protocols are used in WCF services like

  • HTTP
  • TCP
  • MSMQ
  • NAMED PIPE
So an example of the url/address will look like this

http://localhost:4040/PublishService

B ( Binding ) : B stands for Binding, and this defines how the service can be used and called. I mean this says you how the message should pass to the service in order to get the desired out put from the service.

There are many types of bindings like
  • basicHttpBinding
  • wsHttpBinding
  • wsDualHttpBinding
  • netTcpBinding
  • netMSMQBinding
C ( Contract ) : C stands for Contract, that is the interface and this says what the service should do. there are variou contracts like
  • Data Contract ( Data Contract defines the data types used in the service methods. )
  • Operation Contract ( This contracts holds the signature of the service method )
  • Service Contract ( Here the functionality is achieved )
  • Message Contract ( This controls the SOAP messages sent and received by service )
See the next article (Message Layers in WCF) to know the details how the message is being transferred between client and the service in WCF technology.


Happy Coding...

Next

No comments:

Post a Comment