Saturday 31 August 2019

ASP.NET Web Service

Step 1: In ASP.NET Web Application Open Solution Explorer and right click on your project name and navigate to Add>New Item and select web service from the dialog.















Step 2: Now open the web service which you recently added in your project then you will see a window which is as follows:
















As you can see there is a method declared as HelloWorld() which will contains the code of your service which you want to do with the web service.


Step 3: To run the service navigate to WebService2.asmx in your solution explorer and right click on it and select View in browser option.


The corresponding service will be opened in the browser as follows:

output of sevice















Click on HelloWorld link and then after click on Invoke Button then you can see the result of web service in an XML format.