Team LiB
Previous Section Next Section

Creating a Simple Web Service

The following example is a simple Hello World Web Service that you can create. When you're finished entering the code, simply save the file as an .asmx file. To access this page, just go to the following URL:

http://www.macbeth.com/HelloWorld.asmx
Code Example: A Simple Hello World Web Service
Start example
<@ WebService Language="C#" Class="HelloThere" @>
using System.Web.Services

public class HelloThere
{
       [WebMethod]
       public string HelloWorld()
       {
              return "Hello World";
       }
}
End example

Team LiB
Previous Section Next Section