Understanding The Endpoints In WCF

This article explains the endpoints with address, binding and contract features. In my previous article, we saw what is the difference between web services and WCF? The series of article written on WCF are the following:

1. Endpoints

Endpoints is a client and server communication of the address.

end point

Each endpoint consists of the following three components:

  • Address - A
  • Binding - B
  • Contract - C

1.1 Address (Where)

Address uniquely identifies the location of the services. Specified the location of the services URL (Uniform Resource Locator) like the following:

    http://localhost/MyService/HelloWorld.svc

Example: Address

  • http://localhost/
  • http://localhost/MyServices
  • net.tcp://localhost:81/MyService
  • net.pipe://localhost/MyPipeService
  • net.msmq://localhost/MyMsMqService
  • net.msmq://localhost/private/MyMsMqService

1.2 Binding (How)

A binding that specifies how the service can be accessed:

  • Transport protocol ( i.e. TCP or HTTP)
  • Encoding message (i.e. Text or Binary)
  • Security (i.e. SSL or SOAP message security)

Types of Binding

  • BasicHttpBinding
  • WsHttpBinding
  • WsDualHttpBinding
  • WsFederationHttpBinding
  • NetTcpBinding
  • NetNamedPipeBinding
  • NetMsMqBinding
  • NetPeerTcpBinding

BasicHttpBinding

  • Compatible for communicating with ASMX based services used with WS-Basic profile.
  • It uses HTTP transport for communication and text/XML as the default message encoding.
  • It does not support WS-* functionalities such as WS-Addressing, WS-Security, WS-Reliable Messaging.
  • It is not good in interoperability.

WsHttpBinding

  • Supports interoperable binding for non duplex services.
  • It supports WS-* functionality and secure session using SOAP security.
  • It uses HTTP /HTTPS transport for communication.

WsDualHttpBinding

  • It has the same binding approach of WsHttpBinding but additionally it supports duplex service.
  • It supports communication via SOAP.
  • It enables reliable session by default.

WsFederationHttpBinding

  • It supports federated security.
  • It supports WS-Federation protocol.

NetTcpBinding

  • It uses TCP protocol for communication.
  • It supports security, transaction and reliability.
  • It is provide a secure and reliable binding environment for client and server communication.

NetNamedPipeBinding

  • It provides a secure and reliable binding environment for on-machine cross process communication.
  • It provides a full support for SOAP security, transaction and reliability.

NetMsmqBinding

  • It provides a secure and reliable queued communication for cross machine environment.
  • Queuing is provided by using MSMQ.

NetPeerTcpBinding

  • It provides a secure binding for peer-to-peer environment.
  • It uses TCP protocol for communication.
  • It provides full support for SOAP security, transaction and reliability.

1.3 Contract (What)

A contract identifies that what are all the operations available in the service:

Types of Contract

  • Service Contract
  • Data Contract
  • Message Contract
  • Fault Contract

Conclusion

This article helps you to understand the endpoints and its features in WCF.

Thank you for reading my articles.


Similar Articles