Metod overloading in web serive

To overload web methods you have to use MessageName attribute otherwise you will get error.

[WebMethod(MessageName = "Hello")]
public string Hello()
{
return "Hello";
}

[WebMethod(MessageName = "HelloWithFirstName")]
public string Hello(string FirstName)
{
return "Hello " + FirstName;
}

0 comments: