O'Reilly logo

Programming ASP.NET 3.5, 4th Edition by Jesse Liberty, Dan Hurwitz, Dan Maharry

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required