Yes your method has to be static with the WebMethod attribute
Basic example:
CS
using System;
using System.Web.Services;
public partial class _Default : System.Web.UI.Page
{
[WebMethod(EnableSession=false)]
public static string HelloWorld()
{
return "Hello World";
}
}