?
Solved

Raise an event from the web service to a client

Posted on 2009-04-05
3
Medium Priority
?
272 Views
Last Modified: 2012-06-21
Is this possible?

The client and web service were both created using VB.NET 2008 Framework 3.5

Our client application does all of its transactions with the server via a web service. We have a new messaging function which needs to be implemented and in order to receive new messages we need to either poll the server at regular intervals in order to check for new messages, or we need the web server to be able to tell the client application when there is a new message.

The second option is clearly ideal. So the question is how can it be done?
0
Comment
Question by:tfsln
[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 15

Accepted Solution

by:
Solar_Flare earned 2000 total points
ID: 24073969
You cannot do your preferred option with web services. A services sits there waiting to be consumed by a client, and has no way making a connection to the client. In order to acheive this you would need to modify the client to accept incoming tcp connections, and then have the server know the address of each client and initiate a tcp connection from the code-behind to the client when required, and then any firewalls in between are going to be a problem.


The only reasonable way is to have the client poll for new messages.
0
 

Author Comment

by:tfsln
ID: 24073975
So how do instant message applications work? Or any other application which display notifications like that? Do they constantly poll servers to check for new messages/items?

Having the server know the address of each client is not a problem, because i could send that information to the server each time a user logs in. I guess the only problem would be firewalls like you say.
0
 
LVL 15

Expert Comment

by:oobayly
ID: 24077130
IM applications tend to use their own protocol and not http (even if they use tcp 80). Their connections tend to stay open so that data can be pushed back and forth, unlike http which was designed as a stateless protocol: the connections were supposed to be closed after a page was requested. Only with http 1.1 were connections defaulted to remain open as opening connections tend to be expensive.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

719 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