I did some tests on what was possible with 2.0 for versioning of
webservices, the one that I liked the most, Not the one that was
actually implemented , was to make the V1 objects be the base class
and then inherit from them to provide the newer versions.  This allows
the
version 1 clients to keep on working and applications that use the
newer interfaces to do so.  The reason that the design was turned down
was due to the fact that you cannot remove properties from the classes
in a later version. the argument that would break compatiblity for any
solution fell on deaf ears.

Code below was done in the awesome gmail c# editor, so probably doesn't work .

Dave.

  [WebMethod]
       [System.Xml.Serialization.XmlInclude(typeof(FruitV2))]
       public Fruit GetFruit()
       {
#if V1
          Fruit v = new Fruit();
          v.Name = "Apple";
          return v;
#else
           FruitV2 v2 = new FruitV2();
           v2.Color = System.Drawing.Color.Yellow;
           v2.Name = "Bananna";
           return v2;
#endif
       }
   }

   public class Fruit //This is the base class as specced in version 1.

   public class FruitV2 : Fruit   //This class has a modification ,
declared V2.


On 5/16/07, Sébastien Lorion <[EMAIL PROTECTED]> wrote:
Let me rephrase.. They are not using .NET 3.0 API. We would have used WCF
ourselves, but this is not the kind of decision we can force them to take...
especially when this documentation contract is meant to put a foot in the
door for a much larger one ;)

Sébastien


===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to