जगदीश खोलिया: Method Overloading in WCF

Tuesday, May 22, 2012

Method Overloading in WCF

By default overload operations (methods) are not supported in WSDL based operation. However by using Name property of OperationContract attribute, we can deal with operation overloading scenario.
Sample code:

[ServiceContract]
interface ICalculator
{
 [OperationContract(Name = "AddInt")]
   int Add(int arg1,int arg2);

   [OperationContract(Name = "AddDouble")]
   double Add(double arg1,double arg2);
}

No comments: