public void TestServiceStartAndStop() { ServiceHost host = OneCWebService.CreateHost("localhost", 9001); host.Open(); host.Close(); }
protected override void OnStart(string[] args) { string hostName = "localhost"; int port = 9000; if (args.Length >= 2) { hostName = args[0]; port = Convert.ToInt32(args[1]); } host = OneCWebService.CreateHost(hostName, port); host.Open(); //System.Console.WriteLine("Start web service"); }
protected override void OnStart(string[] args) { string hostName = "localhost"; int port = 9000; string logFileName = @"C:\OneCService.log"; if (args.Length >= 2) { hostName = args[0]; port = Convert.ToInt32(args[1]); } if (args.Length >= 3) { logFileName = args[2]; } host = OneCWebService.CreateHost(hostName, port, logFileName); host.Open(); SimpleLogger.DefaultLogger.Severe("Service was started on " + hostName + ":" + port + " with log " + logFileName); //System.Console.WriteLine("Start web service"); }