【发布时间】:2013-01-15 07:51:05
【问题描述】:
我有一个带有两个端点的服务。一个端点用于 wsdual 绑定,另一个用于 tcp 绑定。当我使用 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>
指导我在我的配置中进行哪些更改。谢谢
【问题讨论】:
-
我不确定这是否可行。在这里隐藏一个端点时,确实需要它们的客户端无法再生成代理类。您无法控制消费者使用的“工具”。
标签: wcf