2011-09-20 171 views
1

我創建了一個窗口服務和註冊我的ServerRemoteObject就可以在本地計算機中,我的客戶端應用程序連接到sSrverRemoteObject其他計算機上並運行在本地主機罰款(我的電腦在LAN上)。但是,當我在我的SERVERHOST與Global.asax的仿真窗口服務並註冊該RemoteObject,當我的客戶端應用程序連接到RemoteServerObject我收到此錯誤:在Global.asax中NET遠程處理和無法連接到遠程服務器的客戶端

Error:"Unable to connect to the remote server"

「的Application_Start」我SERVERHOST:

protected void Application_Start(object sender, EventArgs e) 
     { 
      HttpChannel channel = new HttpChannel(9988); 
      ChannelServices.RegisterChannel(channel, false); 
      RemotingConfiguration.ApplicationName = "Proxy"; 
      RemotingConfiguration.RegisterWellKnownServiceType(typeof(ServerRemoteObject), 
       "Server", 
       WellKnownObjectMode.Singleton); 
     } 

客戶端應用程序代碼連接ServerRemoteObject:

Library.IServer serverInstance = (Library.IServer)Activator.GetObject(typeof(Library.IServer), "http://hadeli.somee.com:9988/Proxy/Server"); 
            byte[] bytesRemotibg = serverInstance.Encrypt(GetRequseUrl(value)); 
            byte[] resultProcessRemoting = serverInstance.ProcessToRunning(bytesRemotibg); 
+0

你能夠從你的服務器ping通hadeli.somee.com?你能看到9988端口嗎? – onof

+0

http://support.microsoft.com/kb/323490 –

+0

ONOF:我在http://yougetsignal.com/tools/open-ports網站測試服務器開放的端口,但9988在我訪問的close.on我的主人只端口80,21打開。 –

回答

0

我會趕上在客戶端異常,並確保您AR e從中獲取所有信息(理想情況下記錄到日誌中)。內部異常或堆棧跟蹤應指示您的客戶端是否被允許連接到端點(包括端口)或服務器是否失敗。您還應該在服務器中記錄任何異常。

第一步是確保儘可能多的信息。