WCF Method Overloading
Why WCF not supporting Method Overloading Directly?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Suraj SahooRank #382 · 6.6K reputationPosted Feb 5, 2015, 7:59 AM EST
http://www.codeproject.com/Tips/656042/Method-Overloading-in-WCF
The above link article is a very nice article on this query you have posted. I hope this helps you get some idea on this if you have not been to this link before.
Thanks
rajat kumar56 reputationPosted Feb 16, 2015, 9:20 PM EST
Prashant KoliRank #7,688 · 236 reputationPosted May 12, 2015, 3:02 AM EDT
However in the servicecontract interface, you can try something like this to achieve it:
[OperationContract(Name="MyMethod1")]
string MyMethod(int arg1,int arg2);
[OperationContract(Name = "MyMethod2")]
string MyMethod(double arg1, double arg2);
These will be exposed as two separate methods such as MyMethod1 and MyMethod2 by the WSDL and proxy class and you can call them as per the need.