Accesing a console application from a different machine - .NET
I have a machine A where I run a webservice that needs to invoke a console application on Machine B. Both of them are on the same domain and I can adjust the rights if I need to.
Should I be using remo开发者_JS百科ting for this or does WCF help?
Architecturally, it sounds like you have a Service A that needs to kick-off a workflow and that workflow happens to be a console app. on another server. If that's the case, I would create a Service B that lives on the same server as the console app. and have Service A do a queued call to Service B using WCF. You don't want to call directly as you don't want your service to block on the result of your console app.
There are plenty of good examples of doing queued calls across services. See "queued calls" here. If Service A needs a response from Service B about the success or failure of the call, it's a queued call going back the other way.
If you are on a Windows Domain you can use Sysinternal tools to issue Remote Procedure Calls (RPC).
Sysinternals Suite: http://technet.microsoft.com/en-us/sysinternals/bb842062.aspx
Some of the Sysinternal tools that are helpful for this include:
- psexec.exe - Remotely Execute
- pskill.exe - Kill a Remote Process
- psservice.exe - Start/Stop a remote service
If you are a Linux, I often simply install OpenSSH and then SSH into the other machine. Linux does have a RPC method, but I'm not familiar with it.
精彩评论