Esempio n. 1
0
        public void TestServiceStartAndStop()
        {
            ServiceHost host = OneCWebService.CreateHost("localhost", 9001);

            host.Open();
            host.Close();
        }
Esempio n. 2
0
        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");
        }
Esempio n. 3
0
        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");
        }