Solved

Raise an event from the web service to a client

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

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…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

810 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