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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:14:15+00:00 2026-05-22T03:14:15+00:00

I was looking at using the WCF REST Service Application template to host all

  • 0

I was looking at using the WCF REST Service Application template to host all of my RESTful web services, however, I would also like to be able to expose out my WCF services with a SOAP endpoint.

I can easily get my WCF RESTful services working in WCF 4 using the following example: http://christopherdeweese.com/blog2/post/drop-the-soap-wcf-rest-and-pretty-uris-in-net-4

Is this possible? I would imagine there should be a way in the Global.asax to wire up additional endpoints and specify if one is using basicHttpBinding. Do I need to not use the WCF REST Service Application template and create a standard Service Application and wire it all up via the config?

Thanks for any assistance.

  • 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-22T03:14:16+00:00Added an answer on May 22, 2026 at 3:14 am

    Although in most cases I wouldn’t mix REST and SOAP endpoints, but I agree that in certain cases it’s necessary. The answer to the question: yes, it’s possible to mix them. There are two options you can use:

    The call in Global.asax.cs which defines the route for the REST endpoint

    `RouteTable.Routes.Add(new ServiceRoute("Service1", new WebServiceHostFactory(),   typeof(Service1)))` 
    

    defines essentially a service at the address /Service1. You can add a new “service”, using the same service implementation, but using a different service host factory (instead of using WebServiceHostFactory, which defines a REST endpoint, you’d use your own):

    public class SoapServiceHostFactory : ServiceHostFactory
    {
        protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
        {
            ServiceHost host = base.CreateServiceHost(serviceType, baseAddresses);
            ServiceMetadataBehavior smb = host.Description.Behaviors.Find<ServiceMetadataBehavior>();
            if (smb == null)
            {
                smb = new ServiceMetadataBehavior();
                host.Description.Behaviors.Add(smb);
            }
    
            smb.HttpGetEnabled = true;
            host.AddServiceEndpoint(serviceType, new BasicHttpBinding(), "soap");
            return host;
        }
    }
    

    And in global.asax.cs, RegisterRoutes:

        private void RegisterRoutes()
        {
            // Edit the base address of Service1 by replacing the "Service1" string below
            RouteTable.Routes.Add(new ServiceRoute("Service1", new WebServiceHostFactory(), typeof(Service1)));
    
            RouteTable.Routes.Add(new ServiceRoute("SoapService", new SoapServiceHostFactory(), typeof(Service1)));
        }
    
    • If you actually want to have one “logical” service with two endpoints (I wouldn’t recommend, since the previous approach is simple enough), you can again create a custom ServiceHostFactory, then in that factory you’d add two endpoints: one for REST (using WebHttpBinding/WebHttpBehavior), and one for SOAP (using BasicHttpBinding, for example).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm about to build some RESTful web services using WCF and .NET 3.5 in
I am using wcf ria services in a silverlight application. I am looking at
We are looking at switching from using WCF for our service layer in applications
I'm looking at using ASP.Net MVC as a platform for a REST based Service.
I've been looking for examples for how to write a WCF REST service that
I have a typical Silverlight application with a WCF service and I am using
I am writing a remote service for an application using WCF, in which login
I am looking for any examples or guides to using Linq over WCF (n-tier
I'm looking at using a Windows SharePoint Services 3.0 wiki as a metadata repository.
I am looking at using a custom template for a set of categories. Is

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.