从不同的机器访问控制台应用程序 - .NET
我有一台机器 A,我在其中运行一个 Web 服务,需要调用机器 B 上的控制台应用程序。它们都位于同一域中,如果需要,我可以调整权限。
我应该为此使用远程处理还是 WCF 有帮助?
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 remoting for this or does WCF help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从架构上来说,听起来您有一个服务 A 需要启动一个工作流程,而该工作流程恰好是一个控制台应用程序。在另一台服务器上。如果是这种情况,我将创建一个与控制台应用程序位于同一服务器上的服务 B。并让服务 A 使用 WCF 对服务 B 进行排队调用。您不想直接调用,因为您不希望您的服务阻止控制台应用程序的结果。
有很多跨服务进行排队调用的好例子。请参阅此处的“排队调用”。如果服务 A 需要服务 B 响应有关调用成功或失败的信息,则这是一个以相反方式返回的排队调用。
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.
如果您位于 Windows 域中,则可以使用 Sysinternal 工具发出远程过程调用 (RPC)。
Sysinternals 套件:http://technet.microsoft.com/en-us/sysinternals/ bb842062.aspx
一些对此有帮助的 Sysinternal 工具包括:
服务
如果你使用的是 Linux,我经常简单地安装 OpenSSH,然后通过 SSH 连接到另一台机器。 Linux确实有RPC方法,但我不熟悉。
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:
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.