how do we deprecating / hiding service operation on WSDL

 Posted by Bsrkvarma on 8/28/2014 | Category: WCF Interview questions | Views: 3023 | Points: 40
Answer:

If the user has a service which is used by many clients out of their control.
If Some operations, didn’t make sense , so if we wanted to deprecate those operations, preventing new clients from using them and also didn’t want to break existing clients, hence we couldn’t simply remove the operations, we can use attribute, which would remove the operation from the metadata, but not from the runtime, we can use ServiceMetadataContractBehavior attribute to achieve this..
Eg.

[ServiceContract]
[DeprecatedOperationsWsdlExportExtension]
public interface ICalculator
{
[OperationContract]
int Add(int x, int y);
[OperationContract]
[DeprecatedOperation]
int Divide(int x, int y);
}


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response

More Interview Questions by Bsrkvarma