Wednesday, 14 October 2015

Is Overloading Possible in WCF??

Issues of method overloading in WCF
   Overloading is not possible in WCF because of WSDL(Web Services Description Language) that does not allow creating duplicate methods for clients.
we can achieve Overloading by Below Example
we can be achieved method overloading in WCF by unique operation contract behaviorOperationContract has the Name property that exposes the WCF methods to WSDL Schemas. 

[ServiceContract]
public interface IStudent
{
    [OperationContract(Name="Test1")]
    string TestMethod(int para1,int para2);
      [OperationContract(Name = "Test2")]
    string TestMethod(string para1, string para2);
   }

No comments:

Post a Comment