ASP.NET Web Services

All this is great, but as a Web developer, I don't want to have to go out and learn HTTP, XML, SOAP, WSDL, and DISCO just so that I can trade with my partners. I don't have the time. ASP.NET to the rescue.

The model for creating XML Web services in ASP.NET is very similar to the model for creating programmable pages. Let's create a very simple Web service and look at what it is composed of. In its simplest form, a Web service is a file with an extension, ASMX, that is new to ASP.NET. As you would expect, no HTML is in this page, only code. Listing 6.3 shows the canonical HelloWorld that in some shape or another tends to be every programmer's first application.

Listing 6.3. A Simple Web Service Saying Hello to the World

Get C#® Developer's Guide to ASP.NET, XML, 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.