Web Service Construction

In this section, I will demonstrate the process of creating three types of Web Services. One will be a simple Web Service that returns the sum of two numbers. The second one will return a DataSet containing a table from the Northwind database. A third will demonstrate the use of the [WebMethod] attribute.

For the most part, creating the initial files for the Web Service is a step-by-step process when using the wizard from Delphi for .NET.

1.
Select File, New, Other from the main menu to launch the New Items dialog box.
2.
Select the Item Category, Delphi ASP Projects.
3.
Select the ASP.NET Web Service Application icon (see Figure 28.1). Click OK.
Figure 28.1. ASP.NET Web Service Application icon.

Get Delphi for .NET Developer’s Guide 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.