views:

118

answers:

2

Hi,

I got running a WCF service with custom binding, for now it use httpTransport.

<customBinding>
    <binding name="myHttpBindingConf">
        <context contextManagementEnabled="true" protectionLevel="None"
                    contextExchangeMechanism="ContextSoapHeader" />
        <textMessageEncoding/>
        <httpTransport useDefaultWebProxy="false" />
    </binding>
</customBinding>

I've Made a custom IExtension<OperationContext> to stock my data in a specific context by following those instructions: http://hyperthink.net/blog/a-simple-ish-approach-to-custom-context-in-wcf/

I would like to use a ContextMode.PerSession context.

Which transport choose to get Session management?
How to set new transport in place and letting object discovery enabled?
How to force a PerSession context?

+1  A: 

The ability to establish a session does not necessarily depend only the used transport. E.g. you can use WS-SecureConversion to establish a session and still use HTTP(s) transport.

Check http://msdn.microsoft.com/en-us/library/ms733040.aspx section "System-Provided Session Types".

Also you would usually tie your service instance to a session, not the operation context.

Alex
A: 

You specify it in the implementation of your service rather than in a config file

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
public class MyService : IMyService 
Vitalik
in fact, I don't know how to handle this in my custom behavior made in C# as described in the tutorial...
christophe31