WCF中端点的基址

时间:2017-03-13 07:37:12

标签: c# wcf endpoint

我正在使用WCF并希望创建3个端点:basicHttpBinding,netTcpBinding和wsHttpBinding。 我已经指定了2个端点如下:

<endpoint address="StringManipulationService" binding="basicHttpBinding"
    contract="StringManipulationService.IStringManipulation" />
  <endpoint address="StringManipulationService" binding="netTcpBinding"
    contract="StringManipulationService.IStringManipulation" />

并指定基址如下:

    <baseAddresses>
      <add baseAddress="http://localhost:8080/" />
      <add baseAddress="net.tcp://localhost:8090/" />
    </baseAddresses>

但是我不知道如何为wsHttpBinding写入基地址,并且无法在任何地方找到它。请帮忙。谢谢。

1 个答案:

答案 0 :(得分:1)

 <appSettings> 
      <add key="baseAddress" value="localhost:8000"; /> 
 </appSettings> 



 <endpoint address="" binding="wsHttpBinding"
 contract="StringManipulationService.IStringManipulation" />