To test a web method present inside a web service we need to call the web service through the browser and then invoke the web method. If the web method take some parameter then we have to provide it in the supplied text box as demonstrated in the picture below.
In the above example, I have a web method called “HelloUser(string)” defined in “WebserviceTest” web service. It takes a string variable as parameter named as name. So when I want to invoke the web method for testing then I have to provide the parameter value in the text box as shown above.
But with a little modification to the WebConfig file we can also pass the parameter in the url itself. The process is described as follow:
We have to add the following line of code inside the <system.web> tag of the WebConfig file.
Then we can pass the parameter value by appending it to the url.
[Hope this will help you with your web method testing.]