All the configuration information — when you define your service, you just go and define two endpoints — one for wsHttpBinding and one for netTcpBinding . It is so simple!
<system.serviceModel> <services> <service name="YourNamespace.MyService"> <endpoint address="ws" binding="wsHttpBinding" contract="YourNamespace.IMyService" /> <endpoint address="net.tcp://localhost:8787/MyService" binding="netTcpBinding" contract="YourNamespace.IMyService" /> <host> <baseAddresses> <add baseAddress="http://localhost:8282/" /> </baseAddresses> </host> </service> </services> </system.serviceModel>
Now you have a service that exposes two endpoints:
- using
wsHttpBinding at http://localhost:8282/ws - using
netTcpBinding at tcp://localhost:8787/MyService
Both endpoints are for the same service, for the same service contract, for example. offer the same functionality and service methods.
Each service endpoint in a WCF must define a WCF ABC:
- [A] ddress - where can a service be reached / called?
- [B] inding - how can a service be called (protocol, settings, security, etc.)?
- [C] ontract - what does the service offer at this address, what methods are exposed?
source share