0
我有兩個端點的服務。一個端點用於wsdual綁定,另一個用於tcp綁定。當我與開始我的WCF服務wcfsvchost.exe像在多個端點的客戶端創建WCF代理
WcfSvcHost.exe /service:"C:
\Users\TRIDIP\Documents\Visual Studio 2010\Projects\BBAChatService\BBAChatService\bin
\BBAChatService.dll" /config:"C:\Users\TRIDIP\documents\visual studio 2010\Projects
\BBAChatService\BBAChatService\Web.config"
然後我的服務已啓動。
問題是,當我嘗試在WcfSvcHost.exe啓動服務後,在客戶端創建代理,然後所有終端相關的信息被添加到客戶端的配置文件中,但我希望當我將創建代理與TCP mex端點或mexHttpBinding從客戶端,那麼只有有效的端點應該添加到客戶端的配置文件中,而不是所有的端點。所以引導我在服務端的配置文件中更改什麼。這裏是我的配置文件在服務端....請看看。
<service name="BBAChatService.ChatService" behaviorConfiguration="BBAChatService.ChatServiceBehavior" >
<host>
<baseAddresses>
<add baseAddress ="http://localhost:8732/ChatService.svc/"/>
<add baseAddress ="net.tcp://localhost:7998/ChatService/"/>
</baseAddresses>
</host>
<endpoint name="dual_bind"
address="dual"
binding="wsDualHttpBinding"
bindingConfiguration="WSDualHttpBinding_IChatService"
contract="BBAChatService.IChatService">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<endpoint name="tcp_bind"
address="tcp"
binding="netTcpBinding"
bindingConfiguration="tcpBinding"
contract="BBAChatService.IChatService">
</endpoint>
<endpoint address="net.tcp://localhost:7996/ChatService/mex"
binding="mexTcpBinding"
contract="IMetadataExchange"/>
</service>
指導我在我的配置中更改什麼。謝謝
我不確定這是否可能。當在這裏隱藏一個端點時,確實需要它們的客戶端不能再生成代理類。您無法控制消費者使用的「工具」。 – Aphelion