PageRenderTime 4ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/ExpressInteropBinding/Microsoft.ServiceModel.Interop.Samples/Program.cs

#
C# | 39 lines | 23 code | 7 blank | 9 comment | 0 complexity | 1dbcb4f785cfa7bdcbb69e056960f995 MD5 | raw file
 1// <copyright file="InteropSecurityMode.cs" company="Microsoft Corporation">
 2// Copyright (c) Microsoft Corporation.  All rights reserved.
 3// </copyright>
 4
 5namespace Microsoft.ServiceModel.Interop.Samples
 6{
 7    using System;
 8    using System.ServiceModel;
 9    using System.ServiceModel.Description;
10
11    /// <summary>
12    /// Sample service host
13    /// </summary>
14    public class Program
15    {
16        /// <summary>
17        /// Main method
18        /// </summary>
19        public static void Main()
20        {
21            ServiceHost host = new ServiceHost(
22                typeof(HelloWorldService),
23                new Uri("http://localhost/HelloWorld"));
24
25            host.Open();
26
27            foreach (ServiceEndpoint endpoint in host.Description.Endpoints)
28            {
29                Console.WriteLine(Messages.Listening, endpoint.Address.Uri.AbsoluteUri);
30            }
31
32            Console.WriteLine(Messages.Exit);
33            Console.ReadLine();
34
35            host.Close();
36        }
37    }
38}
39