2011-02-15 46 views

回答

3

是的 - 您可以創建3個不同的端點。

<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> 

你並不需要三種不同的端口,使用上面的例子,你可以在下面的訪問地址您的合同:

http://localhost:8011/IOtherEcho 
http://localhost:8011/IEcho 
http://localhost:8011/ICalculator 
1

1-是的,當然你可以爲每個接口創建一個端點。
2-你是什麼意思的3個不同的條目?

1

這是可能的。鑑於您創建了一個實現3個接口的類,您可以在配置文件中將3個端點節點添加到您的服務中。