I read astronomical blogs on Multiple EndPoints in WCF. As a reader I find some way of ambiguity in author’s explanation to this relatively easy topic. In this post my agenda is very simple. I will not use any code or jargon to explain you multiple EndPoints. I am trying to let you understand Multiple EndPoints with simple mathematical formula.
Mathematically we can formulate EndPoint as below,
Where A, B and C are as follows,
Now it is simple mathematical addition rule that if we change any of A, B or C value then we will get new E.
We may have multiple EndPoints of same service in any of the following scenario,
- Same Service hosted on Multiple Address with same Binding and same Contract.
- Same Service with different Contract on same Address and for same Binding.
- Same Service with different Bindings on same Address and for same Contract.
To map concept of Multiple EndPoints with real world scenario then assume a business case.
- You have a WCF Service
- For Intranet User you do not want authentication
- For Internet User you want authentication
- You want Service to be hosted on same base address
In above scenario
- You need to have different bindings for Intranet client and Internet client.
- You can have basicHttpBinding for Intranet user
- You can have wsHttpBinding for Internet user.
Now in above business case you have same Service hosted on same Address with same Contract but with two different Bindings. Essentially you have two EndPoints for the same Service serving two different purposes.
I hope in this post I was able to explain you basic theory behind Multiple EndPoints. Thanks for reading.
Leave a Reply