Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
I have Windows Service, which is consist of various workflow.

What I am trying to do is start/stop service from my c# application. (Which I can easily do using ServiceController) but service call some third party API which I would like to Mock and and provide a different implementation. (different implementation of code activity)

My question is if I don't want to use dll of these win service in my application, is it possible to access internal WF and code activity using some API provided by .NET and by providing the path where this service is running?

Thanks!
Posted
Comments
Sergey Alexandrovich Kryukov 3-Jan-14 14:00pm    
Not clear. Why you don't want to use ServiceController? What do you want to do with "internal WF"? Do you understand that "from my C# application" (as I understand, other than the service) means IPC; and the processes are isolated?
—SA
prthpatel412 3-Jan-14 14:09pm    
1.I am using ServiceController but It doesn't allow me to access internal WF code activity directly.

2.Internal WF I am interested take some info send that info to 3rd party API. 3rd Party API process that data and give me the response in form of CSV ( they drop it directly on SFTP) .. WF checks SFTP periodically and picks csv and parse it. What I want to do is isolate these complete process. basically I am testing these WinService so I want to get rid of external dependency.

3.I am not familiar with IPC but I will take a look at it. What i meant by "my c# application" is my integration test.
Sergey Alexandrovich Kryukov 3-Jan-14 15:10pm    
Service controller only gives you things like start/stop/pause, but your server code can handle these events and do something else. If could not be enough, because it happens actually on start and stop of the process.

For everything else, you can use IPC. In particular, sockets, named pipes, or, on upper level, remoting or WFC...

Please understand that you cannot be "unfamiliar with IPC", because it is equivalent to not doing any multi-process development at all. This notion includes anything which allows processes to collaborate. Your question is equivalent to the question "how to do IPC in this case".

—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900