Notifying a user on demand

N

Nick

Hi there,

I'm trying to think of a possible waht that I can achieve notifying the
current user of events via a webservice, in realtime. For example, I might
want to pop a message up on the logged on users screen, but not via the page
Load event.

I thought of making a static class with an event delegate, this works in an
isolated project of course, but not from Web Service -> Website, even though
they are in the same application domain.

----

namespace WindowsFormsApplication1
{
class UserNotification
{
public delegate void recievedNotificationHandler(String iUserID);
public static event recievedNotificationHandler
recievedNotification;
public static void notifyUser(String iUserID, Object[]
iNotifyParams)
{
recievedNotification(iUserID);
}
}
}

----

The only other way I can think of is via an Ajax update panel updating on a
regular basis in order to check for notifications, but this wouldn't be
realtime and could cause allot more stress on the server. Any ideas on if
this can be done or not?

Another example of what I want to use this for is to log-off the user
on-demand.

Many thanks for your time.

Nick.
 
N

Nick

Hi Patrice,

The site is for public usage. One reason I mention the capability of
being able to log off the user on-demand would be that it would just mean
that it would be technically possible for me to process any other code, the
logging off on-demand isn't so important, just the practice behind it.

What i'm trying to do is enable a webservice to have extra control over
the logged on user so that I can provide some extra functionality that isn't
currently possible using the standard principals. I'm a little worried
about polling as I'm not sure what impact that would have with 100+ users
polling for notifications at the same time, and of course the delay between
a notification being sent and recieved.

Of course I might be being a tad too over cautious.

Thanks a million for your feedback, I hadn't thought of silverlight as a
possible solution, that could help with a number of issues...

Nick.

Patrice said:
As mosft often knowing the context could help. Is this for general public
or in a controlled environment ?

Depending on the context you could also explore using the "net send"
service, SilverLight, or an instant messaging API ?? If you need to stick
to a basic browser then you'll have likely no other choice than polling...

For logging off a flag that would log them off on the next request
wouldn't be enough ? What is the purpose of login them off ?

--
Patrice

Nick said:
Hi there,

I'm trying to think of a possible waht that I can achieve notifying the
current user of events via a webservice, in realtime. For example, I
might want to pop a message up on the logged on users screen, but not via
the page Load event.

I thought of making a static class with an event delegate, this works in
an isolated project of course, but not from Web Service -> Website, even
though they are in the same application domain.

----

namespace WindowsFormsApplication1
{
class UserNotification
{
public delegate void recievedNotificationHandler(String iUserID);
public static event recievedNotificationHandler
recievedNotification;
public static void notifyUser(String iUserID, Object[]
iNotifyParams)
{
recievedNotification(iUserID);
}
}
}

----

The only other way I can think of is via an Ajax update panel updating on
a regular basis in order to check for notifications, but this wouldn't be
realtime and could cause allot more stress on the server. Any ideas on
if this can be done or not?

Another example of what I want to use this for is to log-off the user
on-demand.

Many thanks for your time.

Nick.
 
S

Steven Cheng [MSFT]

Hi Nick,

From the description in your first message, I think what you want to do the
let the webservice server-side proactively notify the webservice client for
some changing, correct?

I'm afraid this is quite difficult as the webservice by default is used as
the client calls the server for information modal. The server-side doesn't
have any channel to send client-side informaton on the fly. Unless your
webservice client is also a service host which will listening on a certain
port(or host a certain webservice) to let the server-side invoke.

For such kind of "server to client" notification in http based stateless
environment, the most common way is still using a polling approach to
constantly check the server-side status.

Please feel free to post here if you have any other ideas or concerns.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Subject: Re: Notifying a user on demand
Date: Tue, 8 Jul 2008 15:27:34 +0100
Hi Patrice,

The site is for public usage. One reason I mention the capability of
being able to log off the user on-demand would be that it would just mean
that it would be technically possible for me to process any other code, the
logging off on-demand isn't so important, just the practice behind it.

What i'm trying to do is enable a webservice to have extra control over
the logged on user so that I can provide some extra functionality that isn't
currently possible using the standard principals. I'm a little worried
about polling as I'm not sure what impact that would have with 100+ users
polling for notifications at the same time, and of course the delay between
a notification being sent and recieved.

Of course I might be being a tad too over cautious.

Thanks a million for your feedback, I hadn't thought of silverlight as
a
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top