Two-way Communication /w Web Services

H

hufaunder

I am going to write a smart client application. This application will
be used both on an intranet as well as over the internet. Among other
things, the application needs to be able to tell the server to monitor
certain items/tasks and notify the client when the item/task has
changed. Initially, I wanted to use web services but I am not sure how
I would implement a two-way communication between the server and client
(pushing). Is it possible? If so how? If not what are the alternatives?
Remoting? What disadvantages would the alternatives have (security,
access rights, etc).

The only way I can think of right now how to get it to work with
webservices is by making an async call. The server would block the call
until something has changed or a timeout occurs. When the client wants
to be notified of the next change again he will have to make another
async call after the previous one has finished. Would this work?

Thanks
 
G

Guest

Hufaunder,
a stateless HTTP application such as a webservice has no way of simply
dialing up a client over HTTP and saying "hey! Something's changed and here
it is!"

You would either need to use Remoting, or some sort of timer-based polling
mechanism that makes regular webservice method calls to some "GetStatus"
method.


Hope this helps,
Peter
 
H

hufaunder

Peter,

Thanks for the reply. I had the feeling it won't work but was hoping
because Comet (the 'new' Ajax) can push data, too. I'm not familiar
enough with it to know how they achieve that.

In any case, any comments regarding my idea on making async calls and
the server just blocks until something changes? Also, what are the
disadvantages using Remoting over the internet?

Thanks
 
G

Guest

Asynchronous method calls with the server "blocking" until something changes
is not an extensible approach IMHO. You can support events over remoting,
althought most experts recommend against that too. Basically you are turning
the client into a server and the server makes "event" calls to the client.
There aren't any particular issues with remoting over internet as you call
it, you can use either HTTP or TCP channel. Your remoting server can be
hosted in IIS which gives some nice advantages.

What I do is that if the client is expecting some state to change, it simply
polls the server every XX seconds and gets back a state object.
Pete


--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top