// Copyright (C) Microsoft Corporation. All Rights Reserved using System; using System.ServiceModel; namespace Microsoft.ServiceModel.Samples { class Client { static void Main() { // Create a proxy object using the auto-generated // CalculatorClient class. CalculatorClient client = new CalculatorClient(); client.ClientCredentials.UserName.Password = "user4_user4"; client.ClientCredentials.UserName.UserName = "user4"; // Call the Add service operation. double v1 = 100.00D; double v2 = 15.99D; double result = client.Add(v1, v2); Console.WriteLine("Add({0},{1}) = {2}", v1, v2, result); // Closing the client gracefully closes the connection and // cleans up resources client.Close(); Console.WriteLine(); Console.WriteLine("Press to terminate client."); Console.ReadLine(); } } }