Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Wcf basicHttpBinding support PerSession?

Tags:

wcf

Does the basicHttpBinding in WCF support PerSession value in service behavior ?

Where can i find a table which summarize all the information for each binding and its options ? ?

like image 688
Royi Namir Avatar asked Sep 07 '11 07:09

Royi Namir


2 Answers

No, basicHttpBinding does not support this due to the connectionless nature of the HTTP protocol. You may take a look at the following blog post:

For example, the BasicHttpBinding can never have a transport-level session due to the connectionless nature of the HTTP protocol. The WSHttpBinding without security and without reliable messaging will also not maintain a transport-level session. In both of these cases, even though the service is configured with InstanceContextMode.PerSession and the contract with SessionMode.Allowed, the service will behave as a per-call service, and the calls to Dispose() are asynchronous; that is, the client is not blocked after the call while WCF disposes of the instance.

However, if you use the WSHttpBinding with security (its default configuration) or with reliable messaging, or the NetTcpBinding, or the NetNamedPipeBinding, then the service will behave as a per-session service.

And here's a list of system provided bindings along with some of their characteristics.

like image 190
Darin Dimitrov Avatar answered Oct 31 '22 11:10

Darin Dimitrov


basicHttpBinding does not support sessions - you can see a pretty good overview of the binding features on MSDN (scroll down a little for the Binding Features section)

like image 3
marc_s Avatar answered Oct 31 '22 10:10

marc_s