public static SafeServiceHost CreateServiceHost(VLogger logger, ModuleBase moduleBase, ISimplexDoorNotifierContract instance, string address) { //SafeServiceHost service = new SafeServiceHost(logger, moduleBase, instance, address); SafeServiceHost service = new SafeServiceHost(logger, moduleBase, instance, address); //BasicHttpBinding binding = new BasicHttpBinding(); var contract = ContractDescription.GetContract(typeof(ISimplexDoorNotifierContract)); var webBinding = new WebHttpBinding(); var webEndPoint = new ServiceEndpoint(contract, webBinding, new EndpointAddress(service.BaseAddresses()[0])); webEndPoint.EndpointBehaviors.Add(new WebHttpBehavior()); service.AddServiceEndpoint(webEndPoint); service.AddServiceMetadataBehavior(new ServiceMetadataBehavior()); //service.Description.Behaviors.Add(new ServiceMetadataBehavior()); //service.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexHttpBinding(), "mex"); return(service); }
public override SafeServiceHost Create() { var serviceHost = new SafeServiceHost(_proxy, new Uri("net.pipe://localhost/protonvpn-service")); serviceHost.AddServiceEndpoint( typeof(ISettingsContract), BuildNamedPipe(), "settings"); serviceHost.Description.Behaviors.Add(new ErrorLoggingBehavior(_logger)); return(serviceHost); }
public static SafeServiceHost CreateServiceHost(VLogger _logger, ModuleBase _moduleBase, ISimplexLightNotifierContract _instance, string _address) { SafeServiceHost service = new SafeServiceHost(_logger, _moduleBase, _instance, _address); var contract = ContractDescription.GetContract(typeof(ISimplexLightNotifierContract)); var webBinding = new WebHttpBinding(); var webEndPoint = new ServiceEndpoint(contract, webBinding, new EndpointAddress(service.BaseAddresses()[0])); webEndPoint.EndpointBehaviors.Add(new WebHttpBehavior()); service.AddServiceEndpoint(webEndPoint); service.AddServiceMetadataBehavior(new ServiceMetadataBehavior()); return(service); }
public static SafeServiceHost CreateServiceHost(VLogger logger, ModuleBase moduleBase, ISwitchSvcContract instance, string address) { SafeServiceHost service = new SafeServiceHost(logger, moduleBase, instance, address); var contract = ContractDescription.GetContract(typeof(ISwitchSvcContract)); var webBinding = new WebHttpBinding(); var webEndPoint = new ServiceEndpoint(contract, webBinding, new EndpointAddress(service.BaseAddresses()[0])); webEndPoint.EndpointBehaviors.Add(new WebHttpBehavior()); service.AddServiceEndpoint(webEndPoint); service.AddServiceMetadataBehavior(new ServiceMetadataBehavior()); return(service); }
public BluetoothScoutService(string baseAddress, BluetoothScout btScout, ScoutViewOfPlatform platform, VLogger logger) { this.logger = logger; this.bluetoothScout = btScout; service = new SafeServiceHost(logger, platform, this, baseAddress); var contract = ContractDescription.GetContract(typeof(IBluetoothScoutContract)); var webBinding = new WebHttpBinding(); var webEndPoint = new ServiceEndpoint(contract, webBinding, new EndpointAddress(baseAddress)); webEndPoint.EndpointBehaviors.Add(new WebHttpBehavior()); service.AddServiceEndpoint(webEndPoint); service.AddServiceMetadataBehavior(new ServiceMetadataBehavior()); service.Open(); }
public override SafeServiceHost Create() { var serviceHost = new SafeServiceHost(_proxy, new Uri("net.pipe://localhost/protonvpn-service")); serviceHost.AddServiceEndpoint( typeof(IVpnConnectionContract), BuildNamedPipe(), "connection"); serviceHost.Description.Behaviors.Add(new ErrorLoggingBehavior(_logger)); serviceHost.Description.Behaviors.Add( new ParameterValidatingBehavior( new ValidatingParameterInspector(new List <IObjectValidator> { new ValidatableObjectValidator() }))); return(serviceHost); }
public KinectScoutService(string baseAddress, KinectScout kinectScout, ScoutViewOfPlatform platform, VLogger logger) { this.logger = logger; this.kinectScout = kinectScout; service = new SafeServiceHost(logger, platform, this, baseAddress); var contract = ContractDescription.GetContract(typeof(IKinectScoutContract)); var webBinding = new WebHttpBinding(); var webEndPoint = new ServiceEndpoint(contract, webBinding, new EndpointAddress(baseAddress)); webEndPoint.EndpointBehaviors.Add(new WebHttpBehavior()); service.AddServiceEndpoint(webEndPoint); //service.Description.Behaviors.Add(new ServiceMetadataBehavior()); //service.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexHttpBinding(), "mex"); service.AddServiceMetadataBehavior(new ServiceMetadataBehavior()); service.Open(); }