8

I have a WCF Service and a Main Lib1.

Say, I have a Save Profile Service. WCF gets data (with predefined data contract) from client and pass the same to the Main Class Lib1, generate response and send it back to client.

WCF Method : SaveProfile(ProfileDTO profile)

Current Version 1.0 ProfileDTO have the following UserName Password FirstName DOB (In string yyyy-mm-dd) CreatedDate (In string yyyy-mm-dd)

Next Version (V2.0) ProfileDTO have the following UserName Password FirstName DOB (In UnixTimeStamp) CreatedDate (In UnixTimeStamp)

Version 3.0 ProfileDTO have the following (With change in UserName and Password length validation) UserName Password FirstName DOB (In UnixTimeStamp) CreatedDate (In UnixTimeStamp)

In simple we have DataContract and Workflow change between each version 1. How do I name the methods in WCF Service and Main Class Lib1? 2. Do I have to go with any specific pattern for ease development and maintenance? 3. Do I have to have different endpoints for different version?

In the above example I have a method named "SaveProfile". Do I have to name the methods like "SaveProfile1.0", "SaveProfile2.0", etc. If that is the case when there is no change between Version "3.0" and "4.0" then there will difficult in maintenance. I’m looking for a approach that will help in ease maintenance

asked Nov 24, 2013 at 18:20
2
  • 6
    msdn.microsoft.com/en-us/library/ms731060(v=vs.110).aspx Commented Nov 24, 2013 at 22:01
  • One other thing you should consider is raising the notion of version sun-setting so you are setting a clear expectation for how long a version will be available. Commented Jan 24, 2014 at 18:25

1 Answer 1

1

There are two ways to have different versions of the same contact. The first is to use namespaces and the second to use different service names. Personally, I prefer the different namespace approach simply because it encapsulates the "version" with a namespace title and allows callers to be specific about their contract requirements.

However, creating new contract versions has the risk of breaking backward compatibility with existing callers.

answered Nov 25, 2013 at 15:12

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.