Castle Windsor WCF 集成工具的 ServiceSecurityContext 为 null
我正在尝试将 WCF 集成工具与 Castle 一起使用。到目前为止,我的服务器和客户端工作正常。服务器托管在 IIS 7 中(带有没有隐藏代码的 SVC 文件)。
现在我需要知道客户的用户名。为此,我正在做:
OperationContext oc = OperationContext.Current;
ServiceSecurityContext ssc = oc.ServiceSecurityContext;
但 ssc 为空。我想这与在绑定上启用 TransportCredentialOnly 有关,但我没有任何绑定(使用 .NET 4 默认绑定 - 通过该工具)。
所以问题归结为:
如何在服务器端的 WCF 集成设施托管服务中获取客户端用户名。
I'm trying to use WCF Integration Facility with Castle. So far I have the server and the client working fine. The server is hosted in IIS 7 (with a SVC file with no code behind).
Now I need to know the username of the client. For this I'm doing:
OperationContext oc = OperationContext.Current;
ServiceSecurityContext ssc = oc.ServiceSecurityContext;
But the ssc is null. I guess it has something to do with enabling TransportCredentialOnly on binding, but I don't have any bindings (using .NET 4 Default Bindings - through the Facility).
So the question boils down to:
How can I get the client username in a WCF Integration Facility hosted service on the server side.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎对于 Wcf/Castle 相关问题,Castle google group 更有用。如果您登陆这里,可以在 Castle Google Group 的这个帖子中找到答案:
https://groups.google.com/forum/#!topic/castle-project-devel/VOQKW4XlvLM
Seems for Wcf/Castle related issues, Castle google group is much more useful. In case you land here, the answer can be found in this thread of the Castle Google Group:
https://groups.google.com/forum/#!topic/castle-project-devel/VOQKW4XlvLM