What's the standard practice for deprecating a WCF service call?
I have a client/server system whe开发者_运维知识库re one of the wrongly named service calls on the server needs to be deprecated and replaced with the new, better named call. Is there some standard procedure to deprecate the old service call such as logging it's usage or returning a fault exception or something?
thanks, Mark
You should not rename it. You should mark it as obsolete with the following attribute:
[Obsolete("This is a message describing why this method is obsolete")]
and indicate what is the newer method to call.
By doing this, any clients still using this will continue to function.
It's worth noting that this attribute will hide properties/methods from the service metadata, so any client/consumer who creates or updates a reference to this service will lose the property/method completely and be forced not to use it.
精彩评论