<%@ WebService Language="C#" Class="Math" %>
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;
}
}
<%@ WebService Language="VB" Class="Math" %>
Imports System.Web.Services
Public Class Math
Inherits WebService
<WebMethod> _
Public Function Add(num1 As Integer, num2 As Integer) As Integer
Return num1 + num2
End Function
<WebMethod> _
Public Function Subtract(num1 As Integer, num2 As Integer) As Integer
Return num1 - num2
End Function
End Class