.NET Web Services

A .NET Web service is a class that inherits from System.Web.Services.WebService. This class is placed in a source file and saved with an .ASMX extension. Files with an .ASMX extension are a particular flavor of ASP.NET pages. The .ASMX file contains a directive that informs the ASP.NET run time about the nature of the file, the language in use throughout, and the main class that implements the service:

<%@ WebService Language="C#" Class="NWService" %>

The main class must match the name declared in the Class attribute and must be public:

[WebService(Namespace="bwslib/0735615780")]
public class NWService : WebService 
{
⋮
}

Indicating the base class for a .NET Web service is not mandatory. A Web service can also be architected ...

Get Building Web Solutions with ASP.NET and ADO.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.