Ejemplo n.º 1
0
        public ServiceHostDecorator(Type serviceType)
        {
            this.serviceType = serviceType;
            uris             = ServiceRouterHost.GetUris();
            host             = new ExtendedServiceHost(serviceType, uris);
            host.Closing    += new EventHandler(ServiceRouterHost.Host_Closing);
            host.Faulted    += new EventHandler(ServiceRouterHost.Host_Faulted);
            //IServiceBehavior behavior = new EndpointBehavior();
            //host.Description.Behaviors.Add(behavior);


            //BindingElementCollection serviceBec = new BindingElementCollection();
            //SecurityBindingElement serviceSbe = SecurityBindingElement.CreateUserNameForCertificateBindingElement();
            //serviceSbe.EnableUnsecuredResponse = true;
            //serviceBec.Add(serviceSbe);
            //serviceBec.Add(new TextMessageEncodingBindingElement());
            //serviceBec.Add(new HttpTransportBindingElement());
            //Binding serviceBinding = new CustomBinding(serviceBec);
            //host.AddServiceEndpoint()
        }
Ejemplo n.º 2
0
 public void Open()
 {
     host.Open();
     ServiceRouterHost.RegisterWithRouter(host);
 }