Friday, September 03, 2010

WCF InstanceManagement Summary



In WCF, the service instance is a product of binding, contract configuration (SessionMode property on ServiceContract) and service behavior (InstanceContextMode on ServiceBehavior).

The following table summarizes this:

BindingServiceContractAttribute.SessionModeInstanceContextModeAsync Dispose()Service Instance Mode

(behavior of service instance)
BasicHttpAllowed/NotAllowedPerCall/PerSessionYesPerCall
TCP, IPCAllowed/RequiredPerCallNoPerCall
TCP,IPCAllowed/RequiredPerSessionYesPerSession
WS (no security,no reliability)Allowed/NotAllowedPerCall/PerSessionYesPerCall
WS (with security or reliability)Allowed/RequiredPerSessionYesPerSession
WS (with security or reliability)NotAllowed (setting valid because WS implements application level session)PerCall/PerSessionYesPerCall
          

 

No comments: