How we can achieve Operation Overloading while exposing WCF Services?

Answer

By default, WSDL doesn’t support operation overloading. Overloading behavior can be achieved by using “Name” property of OperationContract attribute.

 [ServiceContract]
 interface IMyCalculator
 {
        [OperationContract(Name = “SumInt”)]
        int Sum(int arg1,int arg2);
        [OperationContract(Name = “SumDouble”)]
        double Sum(double arg1,double arg2);
  }

When the proxy will be generated for these operations, it will have 2 methods with different names i.e. SumInt and SumDouble.

All wcf Questions

Ask your interview questions on wcf

Write Your comment or Questions if you want the answers on wcf from wcf Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---