Sessions and Instances

Per Call*

On each request to service (each time we use service method) new instance of Service implementation will be generated. Often this is not suitable for us when we want some to keep track of actions (transactions) or when we access some critical resources.

image_thumb[11]

Per Session*

Is default Session mode. (BTW book on preparation to 70-503 has mistake mentioning that PerCall is default). In this case client knows that Service provides sessions. We can also highlight requirement of using sessions by marking contract with SessionMode.Required. Session is kept with identifier assigned to you proxy class, that you use at client. 

We also have possibility to share same instance of service by passing additional identifier in message header that goes from Client. For that we would need to implement IInstanceContextProvider.

image_thumb[12]

Singleton

Is more rarely used Session mode, but it might be useful when we access one super-critical resource. Plus to that that one plus in using this session mode – possibility to create instance of service even before service host has been created.

image_thumb[13]

* Pictures, but not text below, were taken from training kit book for ms exam 70-503: Link