开发者

OData / WCF Data Services metadata versioning

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 e开发者_如何学JAVAxample 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.


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜