2

Is there any metadata versioning support in OData protocol and its WCF Data Services implementation?

Let us suppose that we have OData service that exposes the single Goods collection, and the Goods entity type has three properties: Key (string), Name (string) and AvailableSince(string). The service is already running, and there are some consumers that rely on this metadata schema. Next, we want to update Goods entity type - for example replace property AvailableSince(string) by something else, or change it type from string to datetime - so we will have two versions of metadata, and consumers thatdepends on the first version of metadata will not be able to send correct requests in terms of 2nd metadata schema.

Is there any way to provide both metadata versions within the single service? If yes, then how consumer can specify metadata version in request, and how it should be processed on WCF side?

Thank to all in advance.

Patrick Desjardins
  • 136,852
  • 88
  • 292
  • 341
sarh
  • 6,371
  • 4
  • 25
  • 29
  • As an aside, OData entities tend to shift a lot less than most interfaces. Yes, new fields will be added over time, but a PurchaseOrder entity will always act more or less the same. The implementation of the UpdatePurchaseOrder method might change under the hood, but the entity itself will stay very similar over time. That's one reason why I love OData and Business Entity-focused development. – Peder Rice Mar 07 '12 at 17:49

2 Answers2

5

Short answer: NO.

Most metadata changes require either a new service or breaking existing clients.

If the existing set of clients is important, our general recommendation is to create a new service...

i.e. something like:

/v1/myservice.svc 
  & 
/v2/myservice.svc

Alex

OData Program Manager

Alex James
  • 20,874
  • 3
  • 50
  • 49
0

This recent article describes on what data changes new service version is required, and what changes do not require service update.

http://msdn.microsoft.com/en-us/library/ee473427.aspx

Dima Stopel
  • 2,427
  • 2
  • 17
  • 12