ASP+ Web Service ASMX directives specify optional settings used by the ASP+ Web Service compilers when processing files. They are located at the top of an application file, and have the syntax:
<%@ directive {attribute=value}* %>
The Web Service directive defines a number of web service specific attributes that the ASP+ Compiler uses when parsing/compiling a web service class. These include:
Attribute | Supported Values | Description |
---|---|---|
CLASS | Any NGWS runtime class | Webservice class to reference |
LANGUAGE | VB, JavaScript, C# | Language used when compiling in-line code within the webservice file. |
An example web service directive can be found below (it instructs the ASP+ compiler to dynamically compile a new web service class -- using C# as its language):
<%@ WebService Language=”C#” %> 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; } }
An alternative webservice directive example follows; it instructs ASP+ to reference a pre-compiled web service class called MyName.MyWebService:
<%@ WebService Class=”MyName.MyWebService” %>