WCF Interview Question
Data Contracts, is used to define Required or NonRequired data members. It can be done with a property named IsRequired on DataMember attribute. [DataContract] public class test { [DataMember(IsRequired=true)] public string NameIsMust; [DataMember(IsRequired=false)] public string Phone; } Can we overload methods in WCF Service or Web Service? Yes for a WCF Service use the Name property of OperationContractAttribute class example: [ServiceContract] interface ddd { [OperationContract(Name = "one")] int calc(int a,int b); [OperationContract(Name = "two")] double calc(double a,double b); } 1)For a Web Service use the MessageName property of WebMethodAttribute class 2)Please comment the following line in the .cs file of the Web Service //[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [WebMethod] public string HelloWorld(string a) { return "Hello"+" "+a; } [WebMethod(MessageName="second...