WCF Endpoints

 

WCF Service is exposes its methods by using Endpoints. Endpoint is a WCF structure which is used to expose the created WCF service to clients.  

A WCF Service can have multiple Endpoints, because of this feature WCF service can be access by different types of distributed technologies. 

Endpoint structure is prepared with three elements. Those are Address, Binding and Contract. 

Address: 

This is the location of WCF service which client programs can use to access the service. WCF follows open standard  W3 policy in writing addresses. The policy specifies not only just the address to be created but also it should include the type of protocol or binding the service offers. 

Eg: 

http://localhost/service

net.tcp://localhost/service 

net.msmq://192.168.100.102/service 

Binding: 

This is the type of communication that is provided for client. Client is supposed to communicate with the given address in the specified binding provided by service. Binding specifies how the Endpoint communicates with the world. 

Binding in Endpoint defines the things like Transport(HTTP, TCP/IP,...etc), Encoding(Text, Binary,....etc) and Security Options(SSL, Message Security..etc). 

Examples of Bindings are BasicHTTPBinding, NetTCPBinding, NetMSMQBinding....etc. 

WCF providing almost 20 different types of Bindings. 

Contract: 

Contract specifies what the Endpoint communicates. It defines things like Message Exchange Pattern(One way, duplex....), service operations and behaviours(Exchange meta data, Impersonation, Authorization.....etc). Behaviour is nothing but some additional information and behaviour is not compulsory. Behaviour is an additional feature that we can provide to our Contract/Endpoint, It is Optional. Only in some cases WCF forces users to add particular Behaviour.