2012-10-28 27 views
0

我可以建立betweeen客戶端和服務器,但每次客戶端調用客戶端的方法激活遠程的對象時,遠程通信,我得到一個System.Net.WebException:.NET遠程處理如何調用客戶端激活的遠程對象上的方法?

{"The underlying connection was closed: An unexpected error occurred on a receive."} 

There is a System.IO.IOException INnerException 
{"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."} 

The stack trace is this: 

"\r\nServer stack trace: \r\n 
at System.Runtime.Remoting.Channels.Http.HttpClientTransportSink.ProcessResponseException(WebException webException, HttpWebResponse& response)\r\n 
at System.Runtime.Remoting.Channels.Http.HttpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)\r\n 
at System.Runtime.Remoting.Channels.SoapClientFormatterSink.SyncProcessMessage(IMessage msg)\r\n\r\n 
Exception rethrown at [0]: \r\n 
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)\r\n 
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)\r\n 
at Remoting.Example.DoSomething() .... 
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n 
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n 
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n 
at System.Threading.ThreadHelper.ThreadStart()" 
+0

只是想確保您知道Remoting已被WCF取代。 –

+0

謝謝你確保我知道。是的我知道。我仍然沒有回答我的問題。 –

+0

你100%確定服務器正在運行? – rene

回答

0

對於所有它的價值,問題解決了當我將服務器和客戶端上的通道從http更改爲tcp時。

相關問題