Monday, 21 December 2009

Boiler plater WCF client

using (ServiceHost serviceHost = new ServiceHost(typeof(WcfServiceLibrary1.TestService)))
            {
                // Open the ServiceHost to start listening for messages.
                serviceHost.Open();
                // The service can now be accessed.
                Console.WriteLine("The service is ready.");
                Console.WriteLine("Press  to terminate service.");
                Console.ReadLine();

                // Close the ServiceHost.
                serviceHost.Close();
            }

No comments: