Example #1
0
        public AxisCamScoutService(string baseAddress, AxisCamScout acScout, VLogger logger)
        {
            this.logger = logger;
            this.axisCamScout = acScout;

            service = new ServiceHost(this, new Uri(baseAddress));

            var contract = ContractDescription.GetContract(typeof(IAxisCamScoutContract));

            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.Open();
        }
        public AxisCamScoutService(string baseAddress, AxisCamScout acScout, VLogger logger)
        {
            this.logger       = logger;
            this.axisCamScout = acScout;

            service = new ServiceHost(this, new Uri(baseAddress));

            var contract = ContractDescription.GetContract(typeof(IAxisCamScoutContract));

            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.Open();
        }