NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ASP+ Web Services Code Declarations Syntax

ASP+ Web Services developers can optionally define new web service classes within a contract file. These classes are defined in-line within the file. Unlike the ASP+ Page and Application files, there is no surrounding <script runat=server> block.

For example:

<%@ 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;
     }
}

Developers can optionally specify the file’s source language using the “language” attribute on the WebService directive. If no language is specified, the ASP+ Compiler will use the default language specified with the application’s config.web configuration file.