Sessions in self-hosted WCF services

你说的曾经没有我的故事 提交于 2019-12-13 03:18:49

问题


prompt please how can I use session in self hosted WCF? I need to implement ASP.NET like sessions (client identification and possibly data sharing). Is there any native way to do so in WCF or I have to implement this behavior manually (sending some unique value with each request and storing them in some sessionID store)? Thanks in advance. P.S. Sorry for poor English.


回答1:


You can have sessions in self-hosted WCF, but you'll need to use a binding which has session support. WSHttpBinding, NetTcpBinding and NetNamedPipeBindings all support sessions, as well as other combination of binding elements in custom bindings. You won't be able to use sessions in a BasicHttpBinding, for example, since you won't have the underlying ASP.NET session object it can take advantage of.



来源:https://stackoverflow.com/questions/6172992/sessions-in-self-hosted-wcf-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!