- Web Method Over Loading in Web Service?
- [WebService]
- public class CustomerService : System.Web.Services.WebService
- {
- [Web Method]
- public int GetAddtionOfNumber(int a,int b)
- {
- return a + b;
- }
- //overload method
- [Web Method]
- public int GetAddtionOfNumber(int a, int b,int c)
- {
- return a + b + c;
- }
- }
This Error Resolving using message name property:
- [WebService]
- public class CustomerService : System.Web.Services.WebService
- {
- [WebMethod(MessageName = "AdditionOfTwoNumber")]
- public int GetAddtionOfNumber(int a,int b)
- {
- return a + b;
- }
- [WebMethod(MessageName = "AdditionOfThreeNumber")]
- public int GetAddtionOfNumber(int a, int b,int c)
- {
- return a + b+c;
- }
- }
No comments:
Post a Comment