The following ASP+ Web Services ASMX file demonstrates linking to an existing precompiled web service class (“MyWebApplication.MyWebService”). It consists of a single declaration:
<%@ WebService Class=”MyWebApplication.MyWebService” %>
The next example demonstrates an ASMX file that instead defines the web service class inline:
<%@ WebService Language=”C#” %> using System.Web.Services; public class Math : WebService { [ WebMethod ] public int Add(int num1, int num2) { return num1+num2; } [ WebMethod ] public int Subtract(int num1, int num2) { return num1-num2; } }