views:

33

answers:

1

I have a windows service in which i host a wcf service. What is the best approach to control the windows service via the wcf service? I already created the interfaces for the wcf service, but I have no idea how to interact with the windows service's classes and functions.

A: 

Hi, just to check that I'm understanding your problem correctly - you want to run a wcf service, so you create a windows service to host it, and you want your desktop client to be able to control the windows service (that's hosting the wcf service) by talking to the wcf service?

If that's the case, what is it that you're trying to do with the windows service? In some of the work I've done, I've set up the server such that there's the windows service hosting all the wcf services I want to run, and in order to interact with that windows service remotely (e.g. starting/stopping/restarting) I have another service running on the server (usually baked into the Amazon instance image so it's running on every new server that gets brought up) which my remote client can talk to instead. That way I have a means to trigger a service restart on all my servers without having to manually connect/remote desktop to each server. Of course, the second wcf service is secured by some means so it can't be exploited easily.

Is that the sort of thing you're looking to do?

theburningmonk
Yes, this is what I want, but having a second service(like you did) is not a good option for me at the moment. I need to have a single service which can be manipulated via wcf.
phm
Ok sure, the only trouble with that approach is that you won't be able to Stop the service as it'll stop your WCF listener too. What sort of information are you looking to get out of your windows service?
theburningmonk