WCF:Why we need the sessions?

Answer Posted / bhuwanesh

To co-relate all the messages sent between two endpoints.

WCF sessions have the following main conceptual features:

* They are explicitly initiated and terminated by the
calling application.

* Messages delivered during a session are processed in
the order in which they are received.

* Sessions correlate a group of messages into a
conversation. The meaning of that correlation is an
abstraction. For instance, one session-based channel may
correlate messages based on a shared network connection
while another session-based channel may correlate messages
based on a shared tag in the message body. The features that
can be derived from the session depend on the nature of the
correlation.

* There is no general data store associated with a WCF
session.

When a service contract specifies that it requires a
session, that contract is specifying that all calls (that
is, the underlying message exchanges that support the calls)
must be part of the same conversation. If a contract
specifies that it allows sessions but does not require one,
clients can connect and either establish a session or not
establish a session. If the session ends and a message is
sent through the same channel an exception is thrown.

Except basichttpbinding, wsHttpBinding and NetTcpBinding
supports session.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the difference between ASMX web services and WCF?

574


what is windows card space?

617


What are the advantages of hosting wcf services in iis as compared to self hosting?

548


What is callback mode in wcf?

545


What is datacontractserializer in wcf?

559






How to host WCF Self-Hosting?

597


What is ConcurrencyMode in WCF?

617


What wcf stands for?

507


What is the difference between wcf and web services?

562


What is the use of the was(windows activation service) compared to other hosting?

497


What is transport reliability in wcf?

566


What do you understand by the term impersonation?

567


What are the advantages of using wcf?

523


What is proxy and how to generate proxy for wcf services?

571


How many types of bindings are in WCF?

598