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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:41:27+00:00 2026-05-21T12:41:27+00:00

I know that similar question was asked here : Running SOAP and RESTful on

  • 0

I know that similar question was asked here :

Running SOAP and RESTful on the same URL

Hosting WCF soap and rest endpoints side by side

but didn’t find an answer to my problem.

I have two custom servicehostfactories that enables Dependency Injection :

public class StructureMapSoapServiceHostFactory : ServiceHostFactory 
public class StructureMapRestServiceHostFactory : WebServiceHost2Factory

The implementation details are not important here.

Then I definied two endpoints in web.config

<system.serviceModel>
    <behaviors>
   <serviceBehaviors>
    <behavior name="mexGet">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
   </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="jsonBehavior">
      <webHttp/>
    </behavior>
  </endpointBehaviors>
</behaviors>
<bindings>
  <mexHttpBinding>
    <binding name="mexHttpBinding" />
  </mexHttpBinding>
</bindings>
      <services>
     <service behaviorConfiguration="mexGet" name="ServiceImplementation.ServiceCategory">
        <endpoint address="rest" 
                  binding="webHttpBinding" 
                  contract="Contracts.ServiceContracts.Mobile.IServiceCategory"
                  behaviorConfiguration ="jsonBehavior"/>
        <endpoint address="soap"
                  binding="basicHttpBinding"
                  contract="Contracts.ServiceContracts.Mobile.IServiceCategory" />
        <endpoint name="mexHttpBinding"
                  address="mex"
                  binding="mexHttpBinding" bindingConfiguration="mexHttpBinding"
                  contract="IMetadataExchange" />
     </service>
  </services>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>

Then I created two .svc files for each custom host factories :
ServiceCategoryRest.svc
ServiceCategorySoap.svc

I don’t like it. What I would like to do is to have URL in that style :

REST : http://server:port/rest/categories/{id} which mapps to the implementation of my ServiceCategory.GetCategory(int id)

SOAP : http://server:port/soap/GetCategory?id=someId

My questions are. Do i need different svc files to activate host services ? If I need there two .svc files, how can I achieve the URI above ? I’m afraid that I should configure IIS rewriting or something but would like to avoid that.

Thanks in advance for your help.

Thomas

  • 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-21T12:41:27+00:00Added an answer on May 21, 2026 at 12:41 pm

    After few searches I found out that in fact I don’t need two different .svc files and two different ServiceHostFactories.

    I kept only the StructureMapRestServiceHostFactory : WebServiceHost2Factory and ServiceCategoryRest.svc which handles well requests in REST mode and call in RPC-SOAP mode.

    So if you want to run side by side the REST and the SOAP you can do it only with WebServiceHost2Factory.

    If then you want to get rid of the .svc part from the URL, please read the Rick Strahl post west-wind.com/weblog/posts/570695.aspx.

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

Sidebar

Related Questions

I know that similar question was asked several times, but still I can't make
I know that my question will be very similar to other ones already asked
I know that this question is very similar to the question posted here .
So a similar question was asked here: Do you know some good resources for
I know that similar questions have been asked before, but I am very much
I know that this is a repeated question. I have found very similar questions
I asked a similar question here where I wanted to get a single div
So I similar question was asked about a year an half ago here: How
I asked a similar question last week but did not get an answer that
My question is similar to the one asked here: http://forum.springsource.org/showthread.php?84508-jdbctemplate.query()-sorted-result-set but a clear answer

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.