Saturday, July 28, 2012

POLLINGDUPLEXHTTPBINDING: HTTP POLLING

POLLINGDUPLEXHTTPBINDING: HTTP POLLING
The changing needs of users have led to the creation of web sites being increasingly interactive.
In this context, Silverlight offers a powerful development platform to create rich, interactive
applications. Silverlight runtime runs as a client in the user ’ s browser process. As with any clients, it
needs to access data remotely, often exposed as service. The more convenient and obvious platform
to develop this service is WCF.
The most common scenario enables a request - reply message exchange pattern where the Silverlight
client sends a request and receives a reply from the service. But sometimes, the service needs to
inform or notify the client when something happens on the other side. The service needs to push
data to the client. PollingDuplexHttpBinding , available since Silverlight v3 in the System.
ServiceModel.PollingDuplex.dll, is designed to accomplish this communication protocol.
PollingDuplexHttpBinding is the implementation of the WS - MakeConnection v1.1 OASIS
Specifi cation ( http://docs.oasis - open.org/ws - rx/wsmc/v1.1/wsmc.html ). In practice, when
a session is established, the client sends the request to the service and the service replies with an
Http response only when it needs to push data to the client — meaning only when there are data
for the client. This is done with a mechanism already known as long polling . If there aren ’ t data for
the client, the service holds on to the latest Http request until there are available data or a timeout
is reached. If the client wants to get more information after receiving one, it re - sends a new Http
request. The communication goes on until an active Http request is alive.
On client side you have to reference the client version of the PollingDuplexHttpBinding from the
System.ServiceModel.PollingDuplex.dll in the Silverlight v3 SDK Libraries path.

No comments:

Post a Comment