假设这是一个ServiceContract
[ServiceContract]
public interface MyService
{
[OperationContract]
int Sum(int x, int y);
[OperationContract]
int Sum(double x, double y);
}
C#中允许方法重载,但WCF不允许重载operation contracts
托管程序在托管时将抛出InvalidOperationException