Assume that this is a ServiceContract
[ServiceContract]
public interface MyService
{
[OperationContract]
int Sum(int x, int y);
[OperationContract]
int Sum(double x, double y);
}
Method overloading is allowed in C#, but WCF does not allow you to overload operation contracts
The hosting program will throw an InvalidOperationException
while hosting
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…