0
我有這種自我託管的服務。在app.config中我定義了兩個基地址。一個用於http,一個用於net.tcp。無論使用何種綁定,WCF都會暴露在所有基地址上的WCF相對端點地址
一個合約通過兩個端點公開,一個是basicHttpBinding,另一個是netTcpBinding。
現在,奇怪的是,兩個端點都可以在兩個baseaddresses。如果我使用wcfclient.exe應用程序連接到任一端點,則兩個端點都顯示出來。即basicHttpBinding net.tcp和其他方式。
這是爲什麼,我能做些什麼嗎?
該參考配置。
<configuration>
<system.serviceModel>
<services>
<service name="FileServer.BookService" behaviorConfiguration="serviceMetadata">
<host>
<baseAddresses>
<add baseAddress="http://localhost"/>
<add baseAddress="net.tcp://localhost"/>
</baseAddresses>
</host>
<endpoint address="BookService"
binding="netTcpBinding"
contract="FileServer.IBookService">
</endpoint>
<endpoint address="BookService/mex"
binding="mexTcpBinding"
contract="IMetadataExchange">
</endpoint>
<endpoint address="BookService"
binding="basicHttpBinding"
contract="FileServer.IBookService">
</endpoint>
<endpoint address="BookService/mex"
binding="mexHttpBinding"
contract="IMetadataExchange">
</endpoint>
<endpoint address="basic"
binding ="basicHttpBinding"
contract="FileServer.ITest">
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="serviceMetadata">
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>