bilal
bilal

Reputation: 658

What is the reason or limitation that we cannot do method overloading in WCF?

Why i can't do method overloading in wcf. What is the reason behind it.

[ServiceContract]
    interface ICalculator
    {
    [OperationContract]
    int Add(int arg1,int arg2);
    [OperationContract]
    double Add(double arg1,double arg2);
    }

Thanks In Advance

Upvotes: 1

Views: 77

Answers (1)

msporek
msporek

Reputation: 1197

The reason you cannot overload methods has to do with the fact that WSDL and SOAP do not support the same overloading concepts present inside of C#. So with 2 methods of the same name it would not be possible to determine which one should be called.

Upvotes: 5

Related Questions