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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:28:13+00:00 2026-05-14T02:28:13+00:00

When you have to introduce a breaking change in a ServiceContract, a best practice

  • 0

When you have to introduce a breaking change in a ServiceContract, a best practice is to keep the old one and create a new one, and use some version identifier in the namespace.

If I understand this correctly, I should be able to do the following:

[ServiceContract(Namespace = "http://foo.com/2010/01/14")]
public interface IVersionedService
{
    [OperationContract]
    string WriteGreeting(Person person);
}

[ServiceContract(Name = "IVersionedService", Namespace = "http://foo.com/2010/02/21")]
public interface IVersionedService2
{
    [OperationContract(Name = "WriteGreeting")]
    Greeting WriteGreeting2(Person2 person);
}

With this I can create a service that supports both versions. This actually works, and it looks fine when testing from soapUI.

However, when I create a client in Visual Studio using “Add Service Reference”, VS disregards the namespaces and simply sees two interfaces with the same name. In order to differentiate them, VS adds “1” to the name of one of them. I end up with proxies called

ServiceReference.VersionedServiceClient

and

ServiceReference.VersionedService1Client

Now it’s not easy for anybody to see which is the newer version.

Should I give the interfaces different names? E.g

IVersionedService1
IVersionedService2

or

IVersionedService/2010/01/14
IVersionedService/2010/02/21

Doesn’t this defeat the purpose of the namespace?

Should I put them in different service classes and get a unique URL for each version?

  • 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-14T02:28:14+00:00Added an answer on May 14, 2026 at 2:28 am

    Well, typically, you would not have a service implementation that implements both the old and the new interface at the same time. Therefore, if a new client comes along and connects to your new service, it would only get the new interface and all is fine.

    If you need to be able to offer up both interfaces, then yes – you need to do some “magic” to make this possible:

    • if you can, derive the new interface from the old. This works as long as you’re only adding on new stuff. A new service implementation would then implement both the old-style interface, as well as the new

      public interface IVersionedService2 : IVersionService1
      {
          [OperationContract(Name = "WriteNewGreeting")]
          Greeting WriteNewGreeting(Person2 person);
      }
      

      So your service implementation would then have both a WriteGreeting as well as a WriteNewGreeting method – the new clients could connect to and use either, while older clients would still see their IVersionService1 interface and the “old” namespace, and thus be able to continue to call your service

    • if you cannot derive the new service from the old, create a completely new service, and expose it on a new endpoint, e.g. a new address or port. That way, existing clients can keep on calling the existing and well known service, while new ones can be directed to a separate service on a separate endpoint and things should be fine for them, too

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

Sidebar

Related Questions

I have some experience with the scala. I want to introduce it into new
We have a production machine and are trying to slowly introduce some 3.0 and
We have to introduce logging in our application. We have decided to use log4j
I am trying to introduce RoR to my company and I have two ways
I have a JSF application that uses mostly Richfaces. I would like to introduce
I would like to introduce multithreading feature in my shell script. I have a
Let's say I have an array of zeros: a = numpy.zeros(1000) I then introduce
I have a class with a vector of pointers to objects. I've introduced some
I have a string where different predefined keywords introduce different data. Is there a
I am working on the front end of an application. I have to introduce

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.