Looking for 开发者_运维技巧this session identifier for logging purposes...
Generally WCF services should be stateless. The default is for them to be stateless without a session id that would tie the server to the client. Unless you have a really good reason (outweighing the performance hits) to maintain state, I'd keep them stateless and sessionless.
That said, you can have per-session WCF services which will allow you to do what you're asking.
This article (link) goes into some detail on instance management with WCF.
For in-depth discussion, take a look at Chapter 4 in Juval Lowy's Programming WCF Services (link) which is all about state management in WCF services.
精彩评论