private void InitRemoteObject() { TLogging.Log("InitRemoteObject in appdomain " + Thread.GetDomain().FriendlyName); RemoteObject = (IMySubNamespace)TConnector.TheConnector.GetRemoteObject(FObjectURI, typeof(IMySubNamespace)); }
static void Main(string[] args) { new TLogging("../../log/TestRemotingClient.log"); try { new TAppSettingsManager("../../etc/Client.config"); TLogging.DebugLevel = Convert.ToInt32(TAppSettingsManager.GetValue("Client.DebugLevel", "0")); new TClientSettings(); // initialize the client TConnectionManagementBase.ConnectorType = typeof(TConnector); TConnectionManagementBase.GConnectionManagement = new TConnectionManagement(); TClientInfo.InitializeUnit(); Catalog.Init("en-GB", "en-GB"); string error; ConnectToTestServer("DEMO", "DEMO", out error); IMyUIConnector MyUIConnector = TRemote.MyService.SubNamespace.MyUIConnector(); TEnsureKeepAlive.Register(MyUIConnector); IMySubNamespace test = TRemote.MyService.SubNamespace; while (true) { try { TLogging.Log(TRemote.MyService.HelloWorld("Hello World")); } catch (Exception e) { TLogging.Log("problem with MyService HelloWorld: " + Environment.NewLine + e.ToString()); } try { TLogging.Log(test.HelloSubWorld("Hello SubWorld")); } catch (Exception e) { TLogging.Log("problem with sub namespace HelloSubWorld: " + Environment.NewLine + e.ToString()); } try { TLogging.Log(MyUIConnector.HelloWorldUIConnector()); } catch (Exception e) { TLogging.Log("problem with HelloWorldUIConnector: " + Environment.NewLine + e.ToString()); } Console.WriteLine("Press ENTER to say Hello World again... "); Console.WriteLine("Press CTRL-C to exit ..."); Console.ReadLine(); } } catch (Exception e) { TLogging.Log(e.ToString()); Console.ReadLine(); } }