我在我的 WCF 服务和代理中使用自定义绑定。我通过从 DuplexClientbase 继承来创建代理。WCF 中是否有一个选项可以帮助我获取调用该方法的用户名?
这是我的绑定
<bindings>
<customBinding>
<binding name="CustomPipeBinding" maxConnections="10" openTimeout="01:20:00" receiveTimeout="20.00:00:00" sendTimeout="01:20:00" closeTimeout="01:20:00">
<windowsStreamSecurity protectionLevel="None" />
<namedPipeTransport maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
<binding name="CustomTcpBinding" maxConnections="10" openTimeout="01:20:00" receiveTimeout="20.00:00:00" sendTimeout="00:05:00" closeTimeout="01:20:00">
<windowsStreamSecurity protectionLevel="None" />
<reliableSession />
<tcpTransport maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"/>
</binding>
</customBinding>
</bindings>