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 372957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:15:40+00:00 2026-05-12T14:15:40+00:00

With regular ASP.NET MVC pages, the repository is passed in to the constructor of

  • 0

With regular ASP.NET MVC pages, the repository is passed in to the constructor of the control. Then the tests can instantiate the controller passing in a mock repository.

How can I do this with web services? The problem I see is that we don’t have the equivalent of ControllerBuilder.SetControllerFactory.

What are the best practices to get my IoC framework (Castle) to instantiate my web service with the correct repository implementation?

I thought there might be a way to extend HttpHandler and change the way the web service is actually instantiated. I believe this is how the MVC framework does it.

  • 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-05-12T14:15:40+00:00Added an answer on May 12, 2026 at 2:15 pm

    I believe you are looking for the Castle Windsor WCF Integration Facility. It provides a ServiceHost implementation that takes over the construction process of your service implementations, utilizing the Windsor IOC. You can inject dependencies like any other IoC app using this facility, and conveniently enough, its part of the Castle project:

    http://www.castleproject.org/container/facilities/trunk/wcf/index.html

    If the Castle Project version does not do what you need it to do, I have my own facility that I created to do the same thing for Windsor before I found the Castle project’s version. They both generally do the same thing, but both also approach the problem a little differently.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Can I use ASP.NET MVC together with regular ASP.NET Web forms Let's
I understand that in ASP.Net DynamicData (and maybe regular ASP or MVC) I can
I am using quartz.net to schedule regular events within asp.net mvc application. The scheduled
i have a regular html Grid and i am binding my asp.net mvc view
What does the regular expression \d{1,6} (used in an ASP.NET MVC route as parameter
I need to implement a regular expression in my asp.net mvc(C#) application using jquery.
I'm trying to improve the performance of an ASP.NET MVC app. Pages take about
I've got controller code like this all over my ASP.NET MVC 3 site: [HttpPost]
Consider an ASP.NET MVC controller method that builds an ASP.NET Chart image. public FileStreamResult
If I'm rendering a regular view in asp.net mvc the only domain object properties

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.