Пример #1
0
        public HttpDescriptorServiceHost(ICremaHost cremaHost, int port, CremaService service)
            : base(cremaHost, typeof(HttpDescriptorService), address, port)
        {
            var binding = CremaServiceItemHost.CreateWebHttpBinding();

            this.service = service;
            var endpoint = this.AddServiceEndpoint(typeof(IHttpDescriptorService), binding, string.Empty);

            endpoint.Behaviors.Add(new WebHttpBehavior());
            this.Description.Behaviors.Add(new InstanceProviderBehavior());

#if DEBUG
            if (Environment.OSVersion.Platform != PlatformID.Unix)
            {
                this.Description.Behaviors.Add(new ServiceMetadataBehavior());
                this.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexHttpBinding(), "mex");
            }
#endif
        }
Пример #2
0
 public DescriptorService(CremaService service, ICremaHost cremaHost)
 {
     this.service   = service;
     this.cremaHost = cremaHost;
 }