Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the standard practice for deprecating a WCF service call?

Tags:

deprecated

wcf

I have a client/server system where 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

like image 498
MStodd Avatar asked Nov 05 '10 16:11

MStodd


1 Answers

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.

like image 80
Liviu Mandras Avatar answered Oct 24 '22 03:10

Liviu Mandras