I use WIF as well so here is what you need

        public class WSTrustServiceModel : WcfServiceModel<WSTrustServiceModel>
        {
                public WSTrustServiceModel()
                {
                }

                public WSTrustServiceModel(IWcfEndpoint endpoint) :
                        base(endpoint)
                {
                }
        }

        public class WSTrustServiceHostBuilder : 
AbstractServiceHostBuilder<WSTrustServiceModel>
        {
                public WSTrustServiceHostBuilder(IKernel kernel)
                        : base(kernel)
                {
                }

                protected override ServiceHost CreateServiceHost(ComponentModel 
model, WSTrustServiceModel serviceModel,
                                                                                
                                 params Uri[] baseAddresses)
                {
                        return CreateServiceHost(model, 
GetEffectiveBaseAddresses(serviceModel, baseAddresses));
                }

                protected override ServiceHost CreateServiceHost(ComponentModel 
model, params Uri[] baseAddresses)
                {
                        if 
(typeof(WSTrustServiceContract).IsAssignableFrom(model.Implementation))
                        {
                                var contract = 
Kernel.Resolve<WSTrustServiceContract>(model.Name);
                                return new WSTrustServiceHost(contract, 
baseAddresses);
                        }

                        return new DefaultServiceHost(model, baseAddresses);
                }

                protected override ServiceHost CreateServiceHost(Type 
serviceType, params Uri[] baseAddresses)
                {
                        return new DefaultServiceHost(serviceType, 
baseAddresses);
                }       
        }

And register it with the facility with

facility.Services.AddServiceHostBuilder<WSTrustServiceHostBuilder>();



On Feb 14, 2011, at 4:46 PM, Scott_M wrote:

> I am writing a custom security token issuer that relies on the 
> Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceHost as the service 
> host.  My token issuer relies upon construction dependency injection.  How do 
> I use the Castle DefaultServiceHostFactory to spit out a WSTrustServiceHost 
> that support construction dependency injection of my custom token issuer?
> 
> 
> 
> 
> thanks
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Castle Project Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/castle-project-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to