Пример #1
0
        private void LoadProductsAndCustomers()
        {
            ZzaProxy proxy = new ZzaProxy("NetTcpBinding_IZzaService");

            //ZzaServiceClient proxy = new ZzaServiceClient("NetTcpBinding_IZzaService");
            try
            {
                Products  = proxy.GetProducts();
                Customers = proxy.GetCustomers();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Failed to load server data. " + ex.Message);
            }
            finally
            {
                proxy.Close();
            }
        }
Пример #2
0
        private void LoadProductsAndCustomers()
        {
            ZzaProxy proxy = new ZzaProxy("NetTcpBinding_IZzaService");

            proxy.ClientCredentials.Windows.ClientCredential.UserName = "******";
            proxy.ClientCredentials.Windows.ClientCredential.Password = "******";
            //ZzaServiceClient proxy = new ZzaServiceClient("NetTcpBinding_IZzaService");
            try
            {
                Products  = proxy.GetProducts();
                Customers = proxy.GetCustomers();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Failed to load server data. " + ex.Message);
            }
            finally
            {
                proxy.Close();
            }
        }