mar*_*c_s 11
您可以在clieint配置中为同一合约和不同地址设置多个端点,没问题.
它们需要由标记name=上的唯一属性分隔<endpoint>.
<client>
<endpoint name="tcpEndpoint"
address="net.tcp://server:8888/SomeService"
binding="netTcpBinding"
contract="IYourService" />
<endpoint name="httpEndpoint"
address="http://server:8777/SomeService"
binding="basicHttpBinding"
contract="IYourService" />
</client>
Run Code Online (Sandbox Code Playgroud)
创建客户端代理时,需要提供要使用的端点的名称:
YourClient client = new YourClient("netTcpEndpoint");
Run Code Online (Sandbox Code Playgroud)
您不能再仅仅实例化您的客户端并期望它找到要使用的"端点",因为有多个(并且没有办法将其定义为"默认",如果没有指定任何内容,很遗憾).
除此之外 - 我认为不会出现任何问题.
| 归档时间: |
|
| 查看次数: |
4292 次 |
| 最近记录: |