如何使用WCF获取远程系统进程列表

时间:2012-11-30 11:13:35

标签: c# wcf remote-server

我正在尝试创建一个WCF服务,该服务将远程系统名称作为参数并在其上运行所有进程。

如果为服务提供了相同的系统名称,则会提供在其上运行的服务的详细信息。但是,如果您提供与托管服务不同的计算机名称,则抛出错误。

我收到错误:

System.ServiceModel.FaultException<System.ServiceModel.ExceptionDetail> was caught
  Message=The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
  Source=mscorlib
  Action=http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher/fault
  StackTrace:
    Server stack trace: 
       at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at ServiceReference1.IService1.GetData(String serverName)
       at ServiceReference1.Service1Client.GetData(String serverName) in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website1\a721c869\c5802e85\App_WebReferences.nbhpvo6i.0.cs:line 53
       at _Default.Button1_Click(Object sender, EventArgs e) in c:\Users\xxxxx\Documents\Visual Studio 2010\WebSites\WebSite1\Default.aspx.cs:line 70
  InnerException:

1 个答案:

答案 0 :(得分:0)

部署了Web服务的服务器以及目标服务器应该运行远程过程调用,服务器和远程注册表窗口服务。

还要检查端口9132,9133和9134是否未被防火墙阻止。