Beispiel #1
0
        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();
        }
Beispiel #2
0
        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();
        }
Beispiel #3
0
        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();
        }
Beispiel #4
0
        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();
        }