WCF Endpoint

This blog is not containing detailed information about Endpoints in WCF but have a summary note.

Every service is associated with a ‘special address' that has three important attributes.  Since, it is not the pure address but special and defines where the service can be found (address), how to access the service (binding) and what this service will do (contract), we say it ‘endpoint'. So an endpoint in WCF has all three ‘where', ‘how', and ‘what' information.

This endpoint is exposed by host. This endpoint plays an important role while accessing services.

How many contracts can be there in an endpoint?

The question is not about how many operation contracts can be there in a service contract but merely about endpoint only. Since, an endpoint is the combination of mentioned 3 attributes i.e. Address, Binding, and Contract, if any will change, your endpoint must be change. So an endpoint can have exactly 1 contract in an endpoint.

Can a service have many endpoints?

Yes, for example, if a service that is going to access on different protocols (binding) can have multiple endpoints. As if any attribute of endpoint address, binding, and contract) change, endpoints get changed also.

So, what are the different ways of configuring endpoints?

There are 3 ways.

 1) Config file

2) Administratively (hosting process's config file) it doesn't require rebuild & redeploy after making any changes into attributes ABC and

3) Programmatically ( setting is not done through config file but in code)

So what are 2 main categories of endpoints?

1)      Business endpoint ( where services are exposed) and

2)      Metadata endpoint

Is it compulsory requiring having metadata endpoint for a business endpoint?

No, metadata is the key for accessing any service at business endpoint and keep the service details in a format ex. WSDL. So this information is mandatory to know at the client for accessing. But there is another ways of providing this metadata information to client. So if it is provided by other mechanism then no need to mention this information at metadata-endpoint.

Ebook Download
View all
Learn
View all