Click on File->New ->project
Select the Asp.NET Empty Web Application and click so it will be creating a new Web application
In that you will be able to add the web service
In solution explore Right Click on the Project and select Add New Item
In the New window opened you will be able to find Web Service
Select that and Click Ok.
So your new web Service has been created
In the code view, you can see lot of comments and C# code already written for you. You will also see that at the bottom, there is a method
HelloWorldwhich is written for you by default, so you can test your service and of course say hello to the world.below is the code which is generated by default...
/// Summary description for WebService1
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
public class WebService1 : System.Web.Services.WebService
public string HelloWorld()
return "Hello World";