Developing an ASP.NET SOAP Web Service

Before WCF and VS2008, the process of developing a web service was nearly identical to that for developing a web page. That approach remains an option, even though it has been superseded by newer WCF facilitated techniques. Here is a list of features that ASP.NET web pages and legacy ASP.NET web services share:

  • All the source files that make up both web pages and services are text files. They can be created and edited in any text editor, and class files can be compiled using a command-line tool from a command prompt.

  • Both web pages and web services can use either the code-behind or the inline coding model. Code-behind is generally considered a technique intended to separate visual content from programmatic content in web pages. As such, its use in web services is less imperative since a web service does not have any visual content. (For a full discussion of the code-behind technique, see Chapter 6.)

  • Both web pages and web services make full use of the CLR and the .NET Framework.

Whereas a web page is defined by its .aspx file, a web service is defined by its .asmx file.

Think of a web service as a class in which some (but not necessarily all) of the methods are exposed to clients over the Internet.

You can easily test an .asmx file by entering its URL into any browser, as in this example:

http://localhost/websites/StockTickerInLine.asmx

The result is shown in Figure 16-4. This test shows a list of usable links to each web method exposed by the web ...

Get Programming ASP.NET 3.5, 4th Edition 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.