views:

21

answers:

2

I'm not sure what the correct method or name to do what I want to do is called, or how it's implemented. My aim is to setup a client that can be updated from the server without a call to the server.

Basically, the following scenario:

  1. Client(1) calls Web Service (GetListOfProducts)
  2. Server returns an array (A, B, C, D) to Client(1).
  3. Client(2) calls Web Service (UpdateProductList) to remove product C.
  4. Server removes product C from list and returns success to Client(2).
  5. Server updates Client(1).
  6. Client(1) updates its listbox and removes item C from the list.

Is Step 5 even possible? Having the server update a client when previous data requested is changed? It seems like this requires databinding, but can it be done across a web service? Oh, and is it possible to do it using HTTP Soap?

+2  A: 

Yes; this is called a WCF Callback. Also see the "gotcha's" listed here; they get a bit complex when you consider reentrancy, multiple instances, and multithreading.

Stephen Cleary
Very helpful links and glad to know the term to use is "WCF Callback" when searching for examples and help...
myermian
A: 

Step is very possible - what you need is some standard protocol for the server to send changes to the clients. Clients register for changes, obviously. There are various ways - from callbacks to regular polling. Nothing particularly hard aout it, though reentrance can be hard if you do not deal with multiple threads regularly.

TomTom