简体   繁体   中英

Sharing session data between ASP.NET app and WCF Webservice through .NET clinet

I have situation, when user prepare some data in ASP.NET application, it save them in session (application does not need database in such case).

To print data on clients label printer I have little .NET WPF application which is opened from the website with session ID parameter. So now I have running application on client, witch knows session ID.

This client should use WCF webservice to get prepared data from server (service because there is more data transfers between client and server). I need to control, how many times data are printed, so data are destroyed on the server after they are fetched for the first time.

Now my question: How can I connect the client/webservice to opened session on the server with prepared data? Webservice is part of the server application.

Thank you for ideas. F.

If you have the session id for an in-memory user session, you should be able to implement the service to require sessions:

MSDN example...

and inject a cookie manufactured by your client including the session id (just like the asp.net app uses) as part of the wcf request.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM