Sending a DataSet Using Web Services

To create a Web service, create a file in your Web project entitled suppliers.asmx. The .asmx extension tells the .NET Framework that this file should be treated as a Web service. Copy and paste the code from Listing 24.1 (or Listing 24.2 if you prefer C#) into the file and save. That's it! You've created your first Web service, which you can view in a browser by navigating directly to the suppliers.asmx URL.

Let's take a moment to the look at the Web service itself. Notice that the very first line of the file is a WebService directive. Up to this point, you have only seen a Page directive in that location. Notice also that the class of the Web service is provided in the WebService directive.

Next, several ...

Get Sams Teach Yourself ADO.NET in 24 Hours 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.