.NET: How to deprecate a WebMethod?
Asked Answered
C

1

7

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?

Centrosymmetric answered 19/4, 2011 at 17:27 Comment(0)
D
6

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.

Dimeter answered 19/4, 2011 at 17:28 Comment(4)
Do you have reason to believe this attribute will make it into the web or service reference?Mady
No it won't. The idea behind a WS in that there is a protocol in place and all vendors (MS, Axis2, etc...) can support the defined protocol. Obsolete is specific to .NET and would not propagate to the WSDL. See #3189244 on deprecation of WCF services which is really a communication effort to your consumer.Dimeter
Right. So if Dan wants to communicate to users that the method is no longer supported, marking it [Obsolete] accomplishes? (Not that I'm arguing against marking it, but I merely feel the answer is incomplete in light of the question.)Mady
@Dan: there is none. The concept of deprecation does not exist in WSDL.Disallow

© 2022 - 2024 — McMap. All rights reserved.