I\'ve been doing some work extending the WCF pipeline of my service using mainly IOperationInvoker
to implement my own functionality.
I am currently using
I believe you need to be linked to OperationContext
not HttpContext
. The answer to similar question is already presented here.
Basically you just need to implement IExtension and plug it into WCF. Step-by-step example can be found for example here.
You can setup your service to be Instance context mode of persession.
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
public class MyService : IMyService
{
private string sessionVar; // for each session
}
And then it is up to client to keep the session alive. In your client you can create a proxy at class level and only close it when you are done with it that way you have sessionVar available.