/ExpressInteropBinding/Microsoft.ServiceModel.Interop.Samples/Program.cs
C# | 39 lines | 23 code | 7 blank | 9 comment | 0 complexity | 1dbcb4f785cfa7bdcbb69e056960f995 MD5 | raw file
Possible License(s): CC-BY-SA-3.0, Apache-2.0
- // <copyright file="InteropSecurityMode.cs" company="Microsoft Corporation">
- // Copyright (c) Microsoft Corporation. All rights reserved.
- // </copyright>
-
- namespace Microsoft.ServiceModel.Interop.Samples
- {
- using System;
- using System.ServiceModel;
- using System.ServiceModel.Description;
-
- /// <summary>
- /// Sample service host
- /// </summary>
- public class Program
- {
- /// <summary>
- /// Main method
- /// </summary>
- public static void Main()
- {
- ServiceHost host = new ServiceHost(
- typeof(HelloWorldService),
- new Uri("http://localhost/HelloWorld"));
-
- host.Open();
-
- foreach (ServiceEndpoint endpoint in host.Description.Endpoints)
- {
- Console.WriteLine(Messages.Listening, endpoint.Address.Uri.AbsoluteUri);
- }
-
- Console.WriteLine(Messages.Exit);
- Console.ReadLine();
-
- host.Close();
- }
- }
- }
-