static void Main(string[] args)
        {
            try
            {
                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);
            }
            catch (Exception e)
            {
                Console.WriteLine("EX: {0}", e.Message);
            }

            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            try
            {
                String filename = "client.exe.config";
                RemotingConfiguration.Configure(filename);

                CustomerManager mgr = new CustomerManager();

                Console.WriteLine("Client.Main(): Reference to CustomerManager " +
                                  " acquired");

                IDictionary props = ChannelServices.GetChannelSinkProperties(mgr);
                props["username"] = "******";
                props["password"] = "******";

                Customer cust = mgr.getCustomer(4711);
                cust = mgr.getCustomer(4711);
                cust = mgr.getCustomer(4711);
                cust = mgr.getCustomer(4711);
                int age = cust.getAge();
                Console.WriteLine("Client.Main(): Customer {0} {1} is {2} " +
                                  "years old.",
                                  cust.FirstName,
                                  cust.LastName,
                                  age);
            }
            catch (Exception e)
            {
                Console.WriteLine("EX: {0}", e.Message);
            }

            Console.ReadLine();
        }
Exemple #3
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();
        }