假设我有一个具有多个端点的 wcf 服务,这些端点具有不同类型的绑定,例如 tcp、basichttp、wshttp 等。
<endpoint address ="" binding="wsHttpBinding"
contract="NorthwindServices.ServiceContracts.ICustomerService"
bindingNamespace = "http://dotnetmentors.com/services/customer" />
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange"/>
<endpoint address ="" binding ="netNamedPipeBinding"
contract ="NorthwindServices.ServiceContracts.ICustomerService"
bindingNamespace = "http://dotnetmentors.com/services/customer" />
<endpoint address="mex" binding="mexNamedPipeBinding"
contract="IMetadataExchange"/>
因此客户端可以使用具有不同绑定的任何端点调用我的服务。当客户端拨打电话以及何时请求将转到服务端时,我如何以编程方式检测正在使用哪个绑定客户端...是 tcp、basichttp、wshttp 吗?
所以用代码示例指导我,它可以帮助我从服务中检测到哪个协议和绑定客户端正在使用。谢谢