WCF Versioning, Naming and Endpoint URL
- by Vinothkumar VJ
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