PageRenderTime 1445ms CodeModel.GetById 45ms RepoModel.GetById 8ms 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
Possible License(s): CC-BY-SA-3.0, Apache-2.0
  1. // <copyright file="InteropSecurityMode.cs" company="Microsoft Corporation">
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. // </copyright>
  4. namespace Microsoft.ServiceModel.Interop.Samples
  5. {
  6. using System;
  7. using System.ServiceModel;
  8. using System.ServiceModel.Description;
  9. /// <summary>
  10. /// Sample service host
  11. /// </summary>
  12. public class Program
  13. {
  14. /// <summary>
  15. /// Main method
  16. /// </summary>
  17. public static void Main()
  18. {
  19. ServiceHost host = new ServiceHost(
  20. typeof(HelloWorldService),
  21. new Uri("http://localhost/HelloWorld"));
  22. host.Open();
  23. foreach (ServiceEndpoint endpoint in host.Description.Endpoints)
  24. {
  25. Console.WriteLine(Messages.Listening, endpoint.Address.Uri.AbsoluteUri);
  26. }
  27. Console.WriteLine(Messages.Exit);
  28. Console.ReadLine();
  29. host.Close();
  30. }
  31. }
  32. }