How to create overloaded web methods in web service?

added by jalpesh
1/29/2013 2:38:37 PM

2 Kicks, 47 Views

Recently some of colleague were discussing about how to create overload methods in web service. We can’t directly create overloaded method web methods for web service. So I thought It would be great idea to write a blog post about it. Function Overloading: Function overloading is one of most known concepts of Object Oriented Programming. It’s a technique to implement polymorphism in code. Like in other programming language in c# you can also create multiple functions with same name and different argument. In function overloading function call will be resolved by ‘Best Match Technique’. Problem: You cannot directly overload method in web service: To understand this let’s create a simple web service with two HelloWorld Methods one with parameter and one without parameter both will return a string. Following is a code for that.