inforakesha

A fine WordPress.com site

WCF BINDING

Leave a comment

In this article we will discuss endpoints which consists of Address, Binding and Contract.

.

WCF–Address-Binding-Contract.jpg

Endpoint

An Endpoint is a piece of information that tells WCF how to build the runtime communication channels to send and receive messages. An endpoint consists of the three things address, binding and contract.

Endpoint.jpg

Address

Address – Where – Where to send messages

An Address is a unique Uniform Resource Locator (URI) that identifies the location of the service. It defines the network address for sending and receiving the messages. It is divided into four parts:

Address.jpg

Binding

Binding – How – How to send messages

A Binding specifies which transport protocol to use, what message format and which any of the ws* protocols we want to use to a particular endpoint.

BasicHttpBinding

  • Replacement for earlier Web Service based on ASMX (Active Server Methods)
  • Supports:
  • HTTP – Hypertext Transfer Protocol
  • HTTPS – Hypertext Transfer Protocol over SSL
    • MTOM – Message Transmission Optimization Mechanism encoding methods.

wsHttpBinding

  • Uses SOAP over HTTP and supports reliability, transactions and security over the internet.
  • Supports:

  • HTTP – Hypertext Transfer Protocol
  • HTTPS – Hypertext Transfer Protocol over SSL
    • MTOM – Message Transmission Optimization Mechanism encoding methods.

wsDualHttpBinding

  • Used for duplex service contract because it supports bidirectional communication.

webHttpBinding

  • Sends information directly over HTTP or HTTPS without creating a SOAP envelope
  • It is a good choice when SOAP is not required by the client

NetTcpBinding

  • Used to send binary-encoded SOAP messages from one computer to another
  • Uses TCP (Transmission Control Protocol) and includes support for reliability, transactions and security

NetPeerTcpBinding

  • Used for peer-to-peer communication over TCP
  • Communication should occur between two or more computers

netNamedPipeBinding

  • Binary encoded SOAP messages are sent over named pipes
  • Used on a single WCF computer

netMSMQBinding

  • Queued binding is used to send binary-encoded SOAP messages over MSMQ
  • Communication should occur between two computers

Contract

A Contract provides the additional detail about the structuring contents of the various messages that will be used by the various operations exposed to the particular endpoints. For example we create a service “TopupService”, the interface used to define the service is “ITopupService” and the project name is “Utility”. The contract for this service would be Utility.ITopupService.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s