Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET: How to deprecate a WebMethod?

In .NET, is there a standard way to indicate that a web service method has been deprecated?

To clarify, by 'web service method', I mean a method that has been decorated with the [WebMethod] attribute.

Is standard practice to just use the [Obsolete] attribute to mark it as deprecated, just like any other method?

like image 824
Dan Esparza Avatar asked Apr 19 '11 17:04

Dan Esparza


1 Answers

Yes; standard practice is to use the [Obsolete] attribute for deprecation within .NET.

EDIT:

Keep in mind that this will not formally propagate to the WSDL/service as exposed to the consumer. Since WS's are a standard across technologies; the protocol has to be honored. With that in mind your goal of propagating change to the consumer will unfortunately be tied to release notes as noted in this question. While not ideal it does provide a vehicle for deprecation.

like image 134
Aaron McIver Avatar answered Oct 14 '22 20:10

Aaron McIver