Creating The Simplest, Shortest Web Service In C#
Since trying to work on a web-service seemsdifficult to new users and inexperienced programmers, this articlepresents a step-by-step method to form a simplest and shortestweb-service in C#.
We'll start off with a web-service in C#.
1.On the start page, click on the New Project button.

After that you'll see the following dialoguebox. Choose Visual C# Project as Project Type, and ASP.NET Web Serviceas Template. If it is your first Web Service, the name would do justfine. But you can name it anyway you want. Then, click OK.

Next you'll see a dialogue box with title Creating New Project.

It'll take a while to create folders of the web service, so there is no rush.
In case if you don't see this dialogue box,there is no need to panic. The next screen is where you ultimately haveto reach, either directly, or through the above dialogue box.
Click on the marked link in the snapshot below.

Now you'll come across some real code. Puttingcuriosity aside, forget about the rest of the code and concentrate onmaking a simple, shortest web service. To do that, scroll down towardsthe end of the code. There you'll see a chunk of code commented, asshown below.

Remove the double slashes (single line comments in C#) from all the enclosed lines.Your code would look like this.

That's all for the coding stuff. Now to compile it, Press F5.
If you've been an obedient reader, the next Window appeared "is" a web service. It would look something like below.

So you see, creating a web service isn't so difficult after all. Hope this would give you some hope to work on Web Services.












No comments yet... Be the first to leave a reply!