private async void LoadProductsAndCustomers() { ZzaProxy proxy = new ZzaProxy("NetTcpBinding_IZzaService"); //ZzaServiceClient proxy = new ZzaServiceClient("NetTcpBinding_IZzaService"); try { //Products = proxy.GetProducts(); //Customers = proxy.GetCustomers(); Products = await proxy.GetProductsAsync(); Customers = await proxy.GetCustomersAsync(); } catch(Exception ex) { MessageBox.Show("Failed to load server data. " + ex.Message); } finally { proxy.Close(); } }
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(); } }