Example
<%@ WebService Language="C#" Class="Util" %>
using System;
using System.Web.Services;
public class Util: WebService
{
[WebMethod]
public int CalculatorAdd(int operandA, int operandB)
{
return operandA + operandB;
}
[WebMethod]
public int CalculatorSubtract(int operandA, int operandB)
{
return operandA - operandB;
}
[WebMethod]
public long CalculatorMultiply(int operandA, int operandB)
{
return operandA * operandB;
}
[WebMethod]
public long CalculatorDivide(int operandNumerator, int operandDenominator)
{
if (operandDenominator == 0)
return System.Int64.MaxValue; // Should really do better error handling overall & return an error
else
return operandNumerator / operandDenominator;
}
}