The reason for writing this article is that a lot of people have published too many articles on creating web services and making it simple but non is actually simple. Almost all of those article focus on the boring theory and functionality of the web service and not on actually what we least require to create a simple web service. Beginners to web services like me get confused in the functionality and un necessary theory. With this confusion the actual cause of creating a very simple web service dies. I have made it very simple to create a .net web service and my readers can extend this article like instead of addition they can put in what ever functionality they want in the WebMethod to get this web service work for them according to their needs.

Some Boring Theory That We Can’t Get Rid Off

When ever we create a web service we need some part of it to be accessed from outside. So that we can call it and make it do something for us. to make a method accessible to the outside world we need to add [WebMethod] Attribute on top of that method.

The method that we need to expose to the outside world must be public.

The file that we need to call is the one with “.asmx” extension to execute our web service.

We can have a private method in our web service that can be called from with in our public method. Like we can have some classes that will have some method that will do some stuff for us. To get access to that functionality of those method. We need to call those methods from our public method by creating objects of those classes in the Service1.asmx file and calling those methods through those objects.

Now Coming To The Real Stuff.

My development environment

Visual Studio 2010

Windows 7 professional 64 bit

Dot net framework 3.5

Creating the Web Service

Open your Visual Studio and click New Project (Section 1 in image). From the left side panel choose C#(Section 2 in image) , Web(Section 3 in image). From the Framework selection dropdown at the top select .Net Framework 3.5 (Section 4 in image) and from the list below that select ASP.Net Web Service Application (Section 5 in image). Give the name of the web service application (Section 6 in image) and the location (Section 7 in image) where it will be saved. Click OK (Section 8 in image)to create the project.