Content feed Comments Feed

The Official ASATO Site

Hi, welcome to my blog. ASP,asp.net,Health,Javascript,JQUERY

WebService Class Introduce

Posted by admin On April - 28 - 2010

Defines the optional base class for XML Web services, which provides direct access to common ASP.NET objects, such as application and session state.
Namespace:  System.Web.Services
Assembly:  System.Web.Services (in System.Web.Services.dll)

Examples
The example below creates an XML Web service, deriving from WebService, in order to use the Context property to obtain the time of the request on the server.
<%@ WebService Language=”C#” Class=”Util” %>
using System;
using System.Web.Services;

public class Util: WebService {
   [ WebMethod(Description="Returns the time as stored on the Server",
   EnableSession=false)]
   public string Time() {
      return Context.Timestamp.TimeOfDay.ToString();
   }
}

Comments are closed.