static void Main(string[] args) { String filename = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; RemotingConfiguration.Configure(filename); IRemoteCustomerManager mgr = (IRemoteCustomerManager)RemotingHelper.CreateProxy(typeof(IRemoteCustomerManager)); Console.WriteLine("Client.Main(): Reference to CustomerManager acquired"); Customer cust = mgr.GetCustomer(4711); int age = cust.GetAge(); Console.WriteLine("Client.Main(): Customer {0} {1} is {2} years old.", cust.FirstName, cust.LastName, age); Console.ReadLine(); }
static void Main(string[] args) { String filename = "client.exe.config"; RemotingConfiguration.Configure(filename); CustomerManager mgr = new CustomerManager(); Console.WriteLine("Client.Main(): Reference to CustomerManager acquired"); Customer cust = mgr.GetCustomer(4711); int age = cust.GetAge(); Console.WriteLine("Client.Main(): Customer {0} {1} is {2} years old.", cust.FirstName, cust.LastName, age); Console.ReadLine(); }
static void Main(string[] args) { String filename = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; RemotingConfiguration.Configure(filename); VerifyRemotingConfiguration(); CustomerManager mgr = new CustomerManager(); Customer cust = mgr.GetCustomer(43); int age = cust.GetAge(); Console.WriteLine("Client.Main(): Customer {0} {1} is {2} years old.", cust.FirstName, cust.LastName, age); Console.ReadLine(); }
static void Main(string[] args) { HttpChannel channel = new HttpChannel(); ChannelServices.RegisterChannel(channel); ICustomerManager mgr = (ICustomerManager)Activator.GetObject( typeof(ICustomerManager), "http://localhost:1234/CustomerManager.soap"); Console.WriteLine("Client.Main(): Reference to CustomerManager acquired"); Customer cust = mgr.GetCustomer(4711); int age = cust.GetAge(); Console.WriteLine("Client.Main(): Customer {0} {1} is {2} years old.", cust.FirstName, cust.LastName, age); Console.ReadLine(); }