In order to enable a custom management of a WCF session, the service contracts have to be decorated with the following attribute: [ServiceBehavior(AutomaticSessionShutdown=false)]. By default the session will be terminated when the WCF call is completed. When a session is established between a WCF service and a client, all client calls are handled by same WCF instance. WCF supports the following types of sessions behaviors:
- System.ServiceModel.Channels.SecurityBindingElement (supports security based sessions)
- System.ServiceModel.NetTcpBinding (supports TCP/IP sessions)
- System.ServiceModel.Channels.ReliableSessionBindingElement (supports reliable sessions)
- System.ServiceModel.NetMsmqBinding (supposrts MSMQ datagram sessions)