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

  • Home
  • SEARCH
  • 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 7182193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:43:04+00:00 2026-05-28T17:43:04+00:00

I’m investigating in using Microsoft’s WCF WebHttp Services for creating a RESTful API. In

  • 0

I’m investigating in using Microsoft’s WCF WebHttp Services for creating a RESTful API. In the past there has been the WCF REST Starter Kit for .NET 3.5, which now seem to have been replaced by the WCF REST Service Template 40 in .NET 4.

Of course I want to use Spring.NET’s DI, but I can’t seem to find any ressources on the web explaining how to successfully integrate Spring.NET into WCF WebHttp Services.

I do know the quite “interesting” way to get Spring into my conventional WCF Services, but does anyone know how to integrate Spring.NET with WCF WebHttp Services?

Some details, to whose are interested:

  • In WCF WebHttp Services I have a global.asax just like in MVC, where I can register routes and stuff.
  • This Global inherits from HttpApplication like the good ol’ SpringMvcApplication does.
  • A route looks a bit different though:

    RouteTable.Routes.Add(new ServiceRoute("MyService", new WebServiceHostFactory(), typeof(MyService)));
    

I would assume two possible ways for hooking Spring into that:

  1. Let Global inherit from some Spring class instead of HttpApplication
  2. When registering the route, use a custom ServiceHostFactory provided by Spring.NET

Does anyone know a ressource or some additional documentation on achieving this? Has anyone done this already?

  • 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-28T17:43:05+00:00Added an answer on May 28, 2026 at 5:43 pm

    I have just had to do the same thing myself, I had to extend the web api http host factory.

    find the details here: Spring.NET WCF Web API

    But in short do this:

    public class Global : HttpApplication
    {
        void Application_Start(object sender, EventArgs e)
        {
            RegisterRoutes();
        }
    
        private void RegisterRoutes()
        {
            RouteTable.Routes.Add(new ServiceRoute("Catalog", new SpringHttpServiceHostFactory(), typeof(UnitysCatalogService)));
        }
    }
    
    public class SpringHttpServiceHostFactory : HttpServiceHostFactory
    {
        private IApplicationContext _applicationContext;
    
        protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
        {
            Configuration.CreateInstance = GetInstance;
            Configuration.ReleaseInstance = ReleaseInstance;
    
            return base.CreateServiceHost(serviceType, baseAddresses);
        }
    
        private object GetInstance(Type serviceType, InstanceContext instanceContext, HttpRequestMessage request)
        {
            return GetApplicationContext().GetObject(serviceType.Name);
        }
    
        private void ReleaseInstance(InstanceContext instanceContext, object instance)
        {
    
        }
    
        private IApplicationContext GetApplicationContext()
        {
            return _applicationContext ?? (_applicationContext = ContextRegistry.GetContext());
        }
    }
    

    and in your web.config:

    <configuration>
      <configSections>
        <sectionGroup name="spring">
          <section name="context" type="Spring.Context.Support.WebContextHandler, Spring.Web" />
        </sectionGroup>
      </configSections>
    
      <spring>
        <context>
          <resource uri="file://~/Config/spring-config.xml" />
        </context>
      </spring>
      <!-- .... -->
    </configuration>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build

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.