public static void startRESTService() { PropertiesFileReader propertyreader = new PropertiesFileReader(HAWCommunicationAgent.CONFIG_PATH); UICRestService DemoServices = new UICRestIMPL(); WebServiceHost _serviceHost = new WebServiceHost(DemoServices, new Uri("http://localhost:" + propertyreader.getValue(UIC_PORT))); _serviceHost.Open(); Console.ReadKey(); _serviceHost.Close(); }
public HAWCommunicationAgent(ISerializer serializer, ILoggerFactory loggerFactory) { this.serializer = serializer; this._loggerFactory = loggerFactory; _logger = loggerFactory.GetLoggerFor(GetType()); _logger.Information("HAW Communication Agent built."); _propertyreader = new PropertiesFileReader(CONFIG_PATH); Thread RestServiceThread = new Thread(RestServer.startRESTService); RestServiceThread.Start(); _instance = this; }