Saturday, October 16, 2010

Binding in WCF: (WCF Part 8)


Choosing a Predefined Binding in WCF:
WCF has nine built-in bindings.e.g.(
NetTcpBinding and other Built-in Bindings )

Defining a Custom Binding in WCF:

A binding is made up of a collection of binding elements, each of which describes some feature of the endpoint's communication. It is important to know about transports, encoding, and other elements when you create a custom binding, because you must choose which elements to put into the stack. A binding must specify at least a transport and an encoder. For example, the NetTcpBinding combines the TCP transport with a binary encoder.

You may wish to create a new binding to accommodate a new transport or encoding.

WCF provides three predefined transports:

  1. HTTP: Used for Web service communication.
    You would choose HTTP if you want to do one of the following:
    1. Host services in IIS 6.0 or later.
    2. Communicate across machines.
    3. Provide good tool support for development, diagnosis, and other activities.
  2. TCP: Typically used for binary communication across computers.
    You would choose TCP if you want to do one of the following:
    1. Provide minimal latency and maximal throughput.
    2. Communicate across computers.
  3. Named Pipes: Provide efficient communication between applications on the same computer.
    You would choose Named Pipes if you want the most efficient communication on a single computer.

In addition to a transport, a binding requires a message encoder to serialize a WCF message into bytes.

WCF has three encoders to handle text, binary, and MTOM data. The text encoder supports plain old XML (POX) as well as SOAP encoding. If your encoding requirement is not handled by these three encoders, you can write your own custom encoder.

  For More Info Please Visit: WCF Resources Page  

No comments:

Post a Comment

Search This Blog