0

method1 is present in service s1, now method1 is moved to service s2.

How to make a notification to the client method1 should be used from s2 and also throw an error if client uses method1 from service s1 ?

pdp16
  • 39
  • 6

2 Answers2

0
[Obsolete("Method1 is deprecated, please use Method2 instead.", true)]

use above code above the definition of obsolete method.

Akshey Bhat
  • 8,227
  • 1
  • 20
  • 20
  • Hi Akshey, As per this link,http://stackoverflow.com/questions/5404863/mark-deprecated-fields-in-wcf-contract it says [Obsolete] property wont work for wsdl references – pdp16 Dec 11 '15 at 12:07
  • I guess then you need to add comment to mention to the client that method is deprecated. – Akshey Bhat Dec 11 '15 at 12:57
0

It is not a good practice to remove operations from the service contract in general as it introduces breaking change and as such should be avoided in single version of API. It would be better to only inform a client/consumer about the change in version X of API and do the breaking change in version X+1 of your API.

However, if you want to inform client/consumer about some planned changes or have any other need to add certain "extra" information to the operation contract, you might take a look at IWsdlExportExtension interface, create a custom attribute that implements it and annotate particular operations.

You may take a look at this article for detailed reference.

Jozef Benikovský
  • 1,121
  • 10
  • 9