Solved

Raise an event from the web service to a client

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Problem with SqlConnection 5 117
Align Buttons next to each other 2 13
Set form below another form 3 26
Getfiles in vb.net 28 22
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…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now