Hi there
The question is answered, probably, here:
https://blogs.msdn.microsoft.com/wenlong/2010/02/20/using-asp-net-sessions-from-wcf/
but that code is all around the OperationContext.Current, which is not NULL only for a given code example.
In my case the system creates all proxies automatically and all I do is calling things like:
LoginServiceReference.LoginClient wc = new LoginServiceReference.LoginClient(); LoginServiceReference.IDTWebUserDTO user = wc.DoLogin(model.Login, model.Password);
It works Ok, but as you may see, the LoginClient is created for me automatically. When calling wc.DoLogin there is no way to get into its context to obtain the OperationContext. For sure, I can modify the generated proxy, but next time the system will re-generate it. Bad approach.
For me the OperationContext.Current is always NULL here. How to get the ASP.NET session ID (as the blogger does in his InitialInvoke() method) and how to assign it (as in his Invoke2() method) ?
Maybe you can suggest other technics to maintain the ASP.NET session for WCF communication?
Thanks.