A couple of possible answers:

1. Can windows services be exposed as web services?

Well, I'm not sure about directly, and I agree with another poster, I'm not
sure you'd want to; however, there is a solution.  Create a web service that
listens for your control messages (and acts as your security agent) and then
when the web service is used it would use an instance of the ServiceControl
class
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html
/frlrfsystemserviceprocessservicecontrollerclasstopic.asp> to send a custom
command to the windows service via the ExecuteCommand method.  The web
service would need to retrieve the service from the SericeControl class to
get an instance, then fire the ExecuteCommand method, passing in an integer
that can be used by the service to inform it to do something.
Unfortunately, there is no way to pass parameters on this call, only a
command to tell the service it should do something (like read parameters for
a database, refresh an internal cache, etc.).

2. What is the best way (from performance perspective) to communicate with a
windows service residing on a remote computer (in an intranet/same security
zone/no firewalls in between)?

You can use the ServiceControl class to point to a remote machine, but I'm
not sure of the requirements of the other machine and what security this
means you would have to set up.  I would assume that the identity of the
account that is using the ServiceControl class would have to have the
correct privileges on the remote box in order to execute the custom command.

MikeWo

-----Original Message-----
From: Ali Khawaja [mailto:[EMAIL PROTECTED]
Sent: Monday, March 01, 2004 12:53 PM
Subject: Communication with Windows Service

I have couple of questions:

1. Can windows services be exposed as web services?
2. What is the best way (from performance perspective) to communicate with a
windows service residing on a remote computer (in an intranet/same security
zone/no firewalls in between)?

Thanks
Ali

===================================
This list is hosted by DevelopMentorR  http://www.develop.com Some .NET
courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to