我遇到了following code :
<client>
<!--set up the destination endpoints-->
<endpoint name="CalcEndpoint1"
address="net.tcp://localhost:9090/servicemodelsamples/service/"
binding="netTcpBinding"
contract="*" />
<endpoint name="CalcEndpoint2"
address="net.tcp://localhost:8080/servicemodelsamples/service/"
binding="netTcpBinding"
contract="*" />
</client>
contract="*"
是什么意思?- 不是每个 WCF 客户端或服务都必须指定契约(Contract)吗?
最佳答案
它用于服务中的路由。星号表示匹配任何传入的契约(Contract)。 我在 VPN 上使用它作为网关来访问防火墙后面的特定服务。我将请求发送到路由器服务,该服务检查契约(Contract),并将其路由到防火墙后面的实际服务。
类似 CodeProject 上的示例
关于c# - 合约="*"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19527767/