Solved

Raise an event from the web service to a client

Posted on 2009-04-05
3
269 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

734 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