File: Default.asmx
<%@ WebService Language="C#" CodeBehind="~/App_Code/Default.cs" Class="Performance.Default" %>
File: ~/App_Code/Default.cs
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
namespace Performance
{
[WebService(Namespace = "http://tempuri.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Default : WebService
{
private static Random _rand = new Random();
[WebMethod]
public bool IsValid()
{
switch (_rand.Next(4))
{
case 0:
case 1:
case 2:
return true;
default:
return false;
}
}
}
}
|