|
using System;
using System.ServiceModel;
using WCFPing.Lib;
namespace WCFPing.Hosting
{
class Program
{
static void Main(string[] args)
{
Uri baseUri11 = new Uri("net.tcp://localhost:1029/Service");
Uri baseUri12 = new Uri("http://localhost:1030/Service");
ServiceHost host = new ServiceHost(typeof(Service), new Uri[] { baseUri11, baseUri12 });
NetTcpBinding binding1 = new NetTcpBinding(SecurityMode.None);
WSHttpBinding binding2 = new WSHttpBinding(SecurityMode.None);
host.AddServiceEndpoint(typeof(IService1), binding1, "IService1");
host.AddServiceEndpoint(typeof(IService1), binding2, "IService1");
host.AddServiceEndpoint(typeof(IService2), binding1, "IService2");
host.AddServiceEndpoint(typeof(IService2), binding2, "IService2");
host.AddDefaultMEXEndPoint();
host.EnablePing();
host.EnableIncludeExceptionInFaultBehavior();
host.Open();
Console.WriteLine(host.QueryServiceEndPoints());
Console.WriteLine("Service Running...");
Console.ReadLine();
host.Close();
Console.ReadLine();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.