Solved

WCF server and client communication

Posted on 2009-07-15
3
850 Views
Last Modified: 2013-12-17
Hi everyone,

I've run into a bit of a complication with my WCF server app.  I'm trying to add an event handler to a custom object so that when the data changes the server calls all the clients that are subscribed to that particular object and notifies them of the update.  My problem is, how in the world do I call specific clients from the server?

 I know a bit about the CallBack feature but I'm unsure how I would only issue this to certain clients, and to my knowledge this only calls back one client, the one who initiated the call to begin with.  I hope this all makes sense.  It is crucial I figure this out to get my record locking mechanism to work.  I've attempted to search for this answer however I'm not too sure what to even search for so if someone could point me in the right direction I would sure appreciate it.  I am using VB so any examples in that format would be most helpful though I'd settle for C#.


Thanks,
Casey


P.S. To elaborate on my intentions: A client requests edit privileges from the server and the server grants them.  The server then issues a lock command to the other client viewing the exact same record.  Those clients will see a padlock appear showing the record is locked and cannot be edited until released by the editor.  When the editor saves the record, the server should call all other subscribed clients and tell them to update and unlock.  Hope this makes it a bit clearer.
0
Comment
Question by:thesnoman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 22

Assisted Solution

by:p_davis
p_davis earned 100 total points
ID: 24865837
you can do this with the post or send callback framework -- with this you will have to have all clients subscribe to your service that is in question and when a client sends an update/create/delete request to this service you can check the callbackchannel and exclude the current subscriber from the updates and fire the rest.

you will need to hold a static list of all subscribers.
you will also need to delete subscribers tha thave a failed connection (it will save you a little speed in the end).

i realize that this is a vague reply to your question but i am hoping to give you a start. with wcf it is important that you dig into the framework with clues from others. the documentation is at best, crappy. unless you really know what you are looking for.
0
 
LVL 25

Accepted Solution

by:
apeter earned 150 total points
ID: 24866579
0
 

Author Closing Comment

by:thesnoman
ID: 31604070
I appreciate both of your replys.  apeter's led me to saving the context of the clients connection to the service on the server which is what I was needing to find out more about so that's the reason I split the points for both of you but awarded more to him.  Thanks again for the help!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question