When you need to make changes to a ServiceContract, it is best to keep the old one and create a new one, and use some version identifier in the namespace.
If I understood this correctly, I would have 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 really works, and it looks great when testing with soapUI.
However, when I create a client in Visual Studio using Add Service Link, VS ignores the namespaces and just sees two interfaces with the same name. To differentiate them, VS adds "1" to the name of one of them. I end up with a proxy called
ServiceReference.VersionedServiceClient
and
ServiceReference.VersionedService1Client
Now it’s not easy for anyone to see which new version.
Should I give the interfaces different names? for instance
IVersionedService1 IVersionedService2
or
IVersionedService/2010/01/14 IVersionedService/2010/02/21
Doesn't that violate the purpose of the namespace?
Should I put them in different service classes and get a unique URL for each version?