Click here to Skip to main content
13,559,479 members
Click here to Skip to main content
Add your own
alternative version


10 bookmarked
Posted 30 Sep 2007
Licenced CPOL

Create a Web Service in Notepad

, 30 Sep 2007
Rate this:
Please Sign up or sign in to vote.
How to create a Web Service in Notepad: most often asked in interviews.


In this article, I'm going to explain how to create a Web Service in Notepad. This will perhaps help you when you are asked in an interview to create a sample Web Service in C# using Notepad.

Using the code

Just follow the steps below. It's an easy and simple exercise.

Step 1

Open Notepad and start typing. In the first line, include the Directory tag as follows:

<%@ WebService Language="C#" Class="MyClass" %>

Step 2

Type the code below in Notepad below the above line:

using System;
using System.Web.Services;
public class MyClass : System.Web.Services.WebService
  public MyClass()
  public string HelloWorld()
    return "Hello Welcome to the World";

Step 3

Check whether your class name and the name in the directory section are the same.

Step 4

Save the Notepad file as "MyWebService.asmx". Don't forget to save the file with the extension ".asmx".

How to access the Web Service

  1. Copy the Web Service into the WWWRoot folder.
  2. Open a new project. Select Solution Explorer.
  3. Add a WebReference. In that, select Available in local machine.
  4. That will list out the available Web Services. Pick the one you created just now.

That's it.

Points of Interest

This demo shows how to create a Web Service without the help of VS.NET. As we know, Web Services can be written/created in any language. I have written this Web Service in C#.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Ganesan Sankaran
Web Developer
India India
I'm Ganesan.S,
Software Engineer
Involved in developing MS applications for last 7 Yrs in VB,VB.NET,ASP.NET,Java Script and C#.NET lately into EPiServer and Ajax.

You may also be interested in...


Comments and Discussions

GeneralMy vote of 4 Pin
swathi.c30-Jul-10 5:44
memberswathi.c30-Jul-10 5:44 
GeneralInteresting Pin
Trollslayer6-Aug-09 22:28
mentorTrollslayer6-Aug-09 22:28 
GeneralError in your article Pin
mav.northwind1-Oct-07 3:47
membermav.northwind1-Oct-07 3:47 
GeneralRe: Error in your article Pin
Ganesan S1-Oct-07 4:00
memberGanesan S1-Oct-07 4:00 
QuestionNotepad ? Pin
toxcct30-Sep-07 23:13
mvptoxcct30-Sep-07 23:13 
AnswerRe: Notepad ? Pin
Pete O'Hanlon30-Sep-07 23:21
memberPete O'Hanlon30-Sep-07 23:21 
GeneralRe: Notepad ? Pin
rilov1-Oct-07 0:12
memberrilov1-Oct-07 0:12 
GeneralRe: Notepad ? Pin
Ram Mohan Raja1-Oct-07 10:22
memberRam Mohan Raja1-Oct-07 10:22 
GeneralRe: Notepad ? Pin
Pawel Krakowiak20-Nov-07 3:06
memberPawel Krakowiak20-Nov-07 3:06 
AnswerRe: Notepad ? Pin
Ganesan S1-Oct-07 18:08
memberGanesan S1-Oct-07 18:08 
GeneralRe: Notepad ? Pin
toxcct1-Oct-07 21:17
mvptoxcct1-Oct-07 21:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web03-2016 | 2.8.180527.1 | Last Updated 1 Oct 2007
Article Copyright 2007 by Ganesan Sankaran
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid