Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8637879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:35:03+00:00 2026-06-12T10:35:03+00:00

I have inherited a project using Castle DI. I am adding a WCF to

  • 0

I have inherited a project using Castle DI. I am adding a WCF to the solution and need to use some of the functions in the solution. The class has the following, which I am assuming is injection.

private readonly IOrderRepository _orderRepository;
    private readonly IEshopOrderRepository _eShopOrderRepository;
    private readonly IUserRepository _userRepository;
    private readonly IListRepository _listRepository;
    private readonly INHibernateRepositoryWithTypedId<ProductVariant, string> _productVariantRepository;

    private readonly IMapper<GiftCardPayment, string, GiftCardPaymentDto> _giftCardDtoMapper;
    private readonly IMapper<AbstractOrder, OrderDto> _orderDtoMapper;
    private readonly IMapper<AbstractOrder, RecurringOrder> _recurringOrder;
    private readonly IMapper<Address, CreditCardPaymentDto> _creditCardDtoMapper;

    public delegate OrderDto ShipmentProcessing(OrderDto order, bool isRecap);

    public OrderManagementService(IOrderRepository orderRepository, IUserRepository userRepository, IListRepository listRepository,
        IEshopOrderRepository eShopOrderRepository,
        INHibernateRepositoryWithTypedId<ProductVariant, string> productVariantRepository,
        IMapper<GiftCardPayment, string, GiftCardPaymentDto> giftCardDtoMapper,
                                  IMapper<AbstractOrder, OrderDto> orderDtoMapper,
        IMapper<AbstractOrder, RecurringOrder> recurringOrder,
        IMapper<Address, CreditCardPaymentDto> creditCardDtoMapper)
    {
        _orderRepository = orderRepository;
        _eShopOrderRepository = eShopOrderRepository;
        _userRepository = userRepository;
        _listRepository = listRepository;
        _productVariantRepository = productVariantRepository;
        _giftCardDtoMapper = giftCardDtoMapper;
        _orderDtoMapper = orderDtoMapper;
        _recurringOrder = recurringOrder;
        _creditCardDtoMapper = creditCardDtoMapper;
    }

All of which works. My question is how do I implement this pattern in the WCF service class. I cannot add the parameters to the constructor because the client will not supply them.

I am able to use the DI in the WCF, so that part is working.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:35:04+00:00Added an answer on June 12, 2026 at 10:35 am

    Castle has a WCF facility for that. In essence it is a custom service factory that creates your service instead of the default factory WCF provides. If you want to use the fluent registration, you have to supply your services to the container used in the service host factory. For that you can create your own service host factory inheriting from the one the castle project provides (Castle.Facilities.WcfIntegration.DefaultServiceHostFactory) and create the windsor container in the factories’ constructor.

    an example implementation for your own service host factory, derived from the DefaultServiceHostFactory supplied by castle:

    public class MyOwnServiceHostFactory: Castle.Facilities.WcfIntegration.DefaultServiceHostFactory
    {
    
        public MyOwnServiceHostFactory() : base(CreateKernel())
        { }
    
        private static Castle.MicroKernel.IKernel CreateKernel()
        {
            var container = new Castle.Windsor.WindsorContainer();
            container.Install(new WindsorInstaller());
            return container.Kernel;
        }
    
    }
    
    
    public class WindsorInstaller : IWindsorInstaller
    {
    
        #region IWindsorInstaller Members
    
        public void Install(Castle.Windsor.IWindsorContainer container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
        {
            container.AddFacility<Castle.Facilities.WcfIntegration.WcfFacility>();
            container.AddFacility<Castle.Facilities.TypedFactory.TypedFactoryFacility>();
    
            container.Kernel.Resolver.AddSubResolver(new Castle.MicroKernel.Resolvers.SpecializedResolvers.ListResolver(container.Kernel));
            // add your services here...
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have inherited my custom class in my project.i.e instead of using the UIViewController
I have inherited some InstallShield InstallScript projects. I am currently using InstallShield 2009. I
I have inherited a web site project that makes use of a number of
I've inherited a java project that appears to have been developed using the NetBeans
I have a public static property in a class. The class has some custom
I have recently inherited a large project using an sqlite3 database and currently I
I've inherited a project and we are using git. We have a number of
I have recently inherited some Java code and need to integrate it into a
I have inherited a project that uses the following pattern for passing parameters from
I have inherited a project from a client, who believes he has all the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.