Search Forum
(57415 Postings)
Search Site/Articles

Archived Articles
712 Articles

C# Books
C# Consultants
What Is C#?
Download Compiler
Code Archive
Archived Articles
Advertise
Contribute
C# Jobs
Beginners Tutorial
C# Contractors
C# Consulting
Links
C# Manual
Contact Us
Legal

GoDiagram for .NET from Northwoods Software www.nwoods.com


              
Printable Version

Creating The Simplest, Shortest Web Service In C#
By Faiza Ajaz

Since trying to work on a web-service seems difficult to new users and inexperienced programmers, this article presents a step-by-step method to form a simplest and shortest web-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 dialogue box. Choose Visual C# Project as Project Type, and ASP.NET Web Service as Template. If it is your first Web Service, the name would do just fine. 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 have to 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. Putting curiosity aside, forget about the rest of the code and concentrate on making a simple, shortest web service. To do that, scroll down towards the end of the code. There you'll see a chunk of code commented, as shown 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.