I'm new in the WCF word
I have 3 different interfaces that i want to exposed to the word.
- I want to defin开发者_开发百科e 3 endpoint - one for each interface - is it possible ?
- In the host - how can i create 3 different entries to those 3 exposed interface ?
Yes- You can create 3 different endpoints.
<service name ="blahblahblah">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8011/" />
</baseAddresses>
</host>
<endpoint address="Stuff"
binding="wsHttpBinding"
contract="ICalculator"
" />
<endpoint address="Stuff"
binding="wsHttpBinding"
contract="IEcho"
/>
<endpoint address="OtherEcho"
binding="wsHttpBinding"
contract="IOtherEcho"
/>
</service>
You don't need three different ports, using above example you can access your contracts on below address:
http://localhost:8011/IOtherEcho
http://localhost:8011/IEcho
http://localhost:8011/ICalculator
1- Yes of course you can create an endpoint for each interface.
2- what do you mean by 3 different entries?
It is possible. Given that you create a class that implements the 3 interfaces, you can just add 3 endpoint nodes into your service in the configuration file.
精彩评论