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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:36:32+00:00 2026-06-12T16:36:32+00:00

Due to some certain requirement, I’ve got to use a single svc for multiple

  • 0

Due to some certain requirement, I’ve got to use a single svc for multiple service versions. I’ve separated the interface contract for each version using different namespaces. I have only one class (partial) implementing all the service versions.

My code is as below:

namespace Application.V1
{
[ServiceContract(Namespace = "http://google.com/ApplicationService/v1.0", Name = "IMathService")]
public interface IMathService
}

namespace Application.V2
{
[ServiceContract(Namespace = "http://google.com/ApplicationService/v2.0", Name = "IMathService")]
public interface IMathService
}

The Application/MathServiceV1.cs file:

public partial class MathService : V1.IMathService { }

The Application/MathServiceV2.cs file:

public partial class MathService : V2.IMathService { }

The Application/MathService.cs file:

public partial class MathService {}

I’ve added the following in the service web.config:

  <service behaviorConfiguration="ServiceBehavior" name="Application.MathService">
    <endpoint address="V1" binding="wsHttpBinding" contract="Application.V1.IMathService" />
    <endpoint address="V2" binding="wsHttpBinding" contract="Application.V2.IMathService" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>

I have a file MathService.svc with the following:

<%@ ServiceHost Service="Application.MathService, Application"
Factory="Autofac.Integration.Wcf.AutofacServiceHostFactory, Autofac.Integration.Wcf"%>

If I generate a proxy with the address http://localhost:8000/MathService.svc the client endpoints are generated as below:

    <client>
        <endpoint address="http://localhost:8000/MathService.svc/V1"
            binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IMathService"
            contract="MathService.IMathService" name="WSHttpBinding_IMathService">
        </endpoint>
        <endpoint address="http://localhost:8000/MathService.svc/V2"
            binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IMathService1"
            contract="MathService.IMathService1" name="WSHttpBinding_IMathService1">
        </endpoint>
    </client>

My concern is that the client endpoint address is generated with MathService.svc/V1 but I’d like to see V1/MathService.svc.

If i browse the service with the address http://localhost:8000/MathService.svc/V1 i am getting HTTP 400 Bad Request error.

Any suggestions?

  • 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-12T16:36:33+00:00Added an answer on June 12, 2026 at 4:36 pm

    Regarding your 400 bad request error – you probably dont have MEX enabled, so making a request without a payload makes no sense to the service.

    Here is a question about enabling MEX:
    WCF How to enable metadata?
    Either enable MEX – or use a proper service consumer to call your service.

    Regarding your addressing – you cannot do what you want to do with WCF alone. Because you are using IIS hosted WCF (I assume this because you are using an SVC file), your HTTP request must be directed to the location of your SVC file, and anything after that (/V1 for example) is used to locate the appropriate endpoint. This is just how it works in IIS. Putting the /v1/ BEFORE the file name (MathService.asmx) tells IIS to look for a folder called /v1/ before attempting to locate a file named MathService.asmx – obviously it wont find anything there!

    However, you may be able to install a URL rewriter in your Web.config to redirect your preferred URI to the one mentioned above.
    Here is some documentation on Url rewriting in asp.net:
    http://www.iis.net/learn/extensions/url-rewrite-module/iis-url-rewriting-and-aspnet-routing

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

Sidebar

Related Questions

I'm using a handler to poll certain information out my application. I've got some
Due to some css limitations between IE and the rest of the world I
Due to some limitations on the place files are being placed, I would like
Due to some rather bizarre architectural considerations I've had to set up something that
Due to some changes on AD-level I have to change a lookup in AD
due to some unavoidable reasons I need to disable Google Chrome's Chrome PDF Viewer
I have some idea that it is due to some complex calculation, but i
I noticed some XSS attempts on some of our sites due to some old
I've recently switched focus from VB.NET to C# due to some decisions at work.
I'm having some issues with my code. This is probably due to some design

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.