internal static void Initialise(NVRServiceAct nvrService) { try { _logger.Info(""); _logger.Info("-----------------------------------l-"); _logger.Info("starting CameraControlService service"); _nvrService = nvrService; Uri httpUrl = new Uri("https://localhost:6530/CameraControlService"); //Create ServiceHost WebServiceHost serviceHost = new WebServiceHost(typeof(CameraControlService), httpUrl); WebHttpBinding _webhttpbis = new WebHttpBinding(WebHttpSecurityMode.Transport); _webhttpbis.MaxReceivedMessageSize = 1073741823; _webhttpbis.ReceiveTimeout = TimeSpan.Parse("00:10:00"); _webhttpbis.CloseTimeout = TimeSpan.Parse("00:10:00"); _webhttpbis.OpenTimeout = TimeSpan.Parse("00:10:00"); _webhttpbis.SendTimeout = TimeSpan.Parse("00:10:00"); _webhttpbis.MaxBufferPoolSize = 524288; _webhttpbis.CrossDomainScriptAccessEnabled = true; var endpoint = serviceHost.AddServiceEndpoint(typeof(ICameraControlService), _webhttpbis, "");//WSHttpBinding ServiceThrottlingBehavior throttleBehavior = new ServiceThrottlingBehavior { MaxConcurrentCalls = 500, MaxConcurrentInstances = 500, MaxConcurrentSessions = 500, }; serviceHost.Description.Behaviors.Add(throttleBehavior); WebHttpBehavior behavior = new WebHttpBehavior(); behavior.DefaultOutgoingResponseFormat = WebMessageFormat.Json; endpoint.Behaviors.Add(behavior); serviceHost.Open(); _logger.Info("CameraControlService service started successfully"); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); //amit 04112016 return; //service; } catch (Exception ex) { _logger.Info("GeoTrackingService Initialise() Exception" + ex.Message); string Message = "GeoTrackingService-Initialise() -- Exception = " + ex.Message; InsertIntegrationLog.AddProcessLogIntegration(Message); return; } finally { } return; }
public Mediaintegration() { _nvrServices = new NVRServiceAct(); //_nvrServices.Initialize(); }