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 xmlserializer and the datacontractserializer?

491


explain service contracts? : Wcf data services

481


What is the difference between wcf service and web service?

465


Explain the difference between transport and message level security.

425


Describe the wcf architecture?

459






What is contract? What are the types of contract?

465


Explain the role of WSDL in WCF?

487


explain wcf basic binding type? : Wcf data services

424


How many types of binding are there in wcf?

451


What is abc in wcf?

451


What are the types of binding available in wcf?

503


How datacontractserializer different from xmlserializer?

470


Which specifications does wcf follow?

481


What is wcf and wpf in dotnet?

439


Explain Address, Binding, and contract for a WCF Service?

448