C#WebService自己的会话 [英] C# WebService own session

查看:116
本文介绍了C#WebService自己的会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我有WebService客户端(已预定),我必须编写WebService服务器。客户端向我的服务器发送少量请求,我必须存储所有数据。客户端拥有自己的会话ID,可以在每个请求中发送给我。在c#中我有没有根据请求sessionID确定获取/创建当前会话的解决方案?



更新:

也许我没有知识知道我想要的东西:(客户端可以验证并向服务器询问一些问题,但我不知道他是否退出。示例:人员登录到hostA中的应用程序并对我的服务器进行身份验证,提出一些问题并在应用程序中注销(但服务器不知道这一点).B人B登录到hostA并开始询问任务(请求更改中只有ID)。好的,我可以检查requestID是否有更改,如果是,可以清理会话并询问对于身份验证.....但是......

如果我有正确的会话是简单的,线程安全的字典,当超过指定的超时值时过期并在后台创建(通过cookie等)我想知道是否有这样的方法Session.Start(字符串RequestID)获取或创建新会话(如果会话RequestId不存在)。

对不起我的engli sh。

Hello,
I have WebService client (predetermined) and I have to write WebService server. Client send few request to my server and I have to store all data. Clients has own session ID which send me in every request. Is there any solution in c# that I determine, based on request sessionID, to get/create current session?

UPDATE:
Maybe I don't have knowledge to know what I want:( Client can authenticating and ask some question to server, but I don't know if he logout. Example: Person A login to application in hostA and authenticate to my server, ask some question and logout in application (but server doesn't know about this). Person B login to hostA and start asking questing (only ID in request changes). Ok, I can check if requestID have change and if so a can clean session and ask for authenticate..... but.....
If I have right session is simple, thread-safe dictionary which expired when exceeds the specified time-out value and is create in background (by cookie etc.) and I wonder if is something like this with method Session.Start(string RequestID) which get or create new session (if session RequestId doesn't exist).
Sorry for my english.

推荐答案

这篇关于C#WebService自己的会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆