ASP.NET XML Web Services

ASP.NET greatly simplifies the development of logic and the user interface while still increasing the power of web pages for web users. Microsoft did not stop there. With ASP.NET XML Web Services, Microsoft expands the event-driven object architecture of .NET to provide multiple paths for applications and processes to communicate. For example, say you have a network consisting of several geographically distributed web servers hosting various corporate and subordinate company intranets and databases. Each site displays the corporate news. Imagine the complexity and the timing of continually rolling out new corporate messages. With .NET framework and ASP.NET, you can create a News XML Web Service on the corporate site, and the other sites can access and pull information as needed from this web service. No more worries about data replication or timing issues.

Although useful to illustrate the point, a news subscription is a simplistic example of the power of XML Web Services. Imagine a web application that is literally built on functions and processes spread across the world but exposed through XML Web Services. What's more, XML Web Services aren't limited to web browsers. Any application that can connect to the web can connect to XML Web Services. XML Web Services offer you a choice of connection protocols. Any application or process can access an XML Web Service through HTTP-GET, HTTP-POST, or Simple Object Access Protocol (SOAP).

HTTP-GET HTTP-GET is a standard protocol that you've probably seen used in HTML forms. HTTP-GET simply requests a web service through a URL and sends and receives data through HTML. Any parameters that should be passed are sent in the URL.

HTTP-POST HTTP-POST is the counterpart to HTTP-GET. The difference is that HTTP-POST sends parameters through the HTTP request message and not through the URL.

SOAP SOAP is an up-and-coming protocol that allows servers to send and receive data. SOAP depends on XML to pass and receive information. Obviously, XML can send and receive a great deal more information than the value-pair limitation of HTTP-GET and HTTP-POST. SOAP is the default protocol that web services use to transmit information.XML Web Services promise a truly expansive method to deliver applications over the Internet. However, delving into XML Web Service programming, deployment, and accessing is outside the scope of this book. To give you an idea of web service programming, Listing 14.12 shows a simple script that creates an XML Web Service. Once you've saved this script you can access the web service through your site. ASP.NET automatically generates a web page to view the class, methods, and properties of the HelloWorld web service, as shown in Figure 14.12.

Listing 14.12: HELLOWORLD_WS.ASMX

start example
<%@ WebService Language="VB"  %> Imports System Imports System.Web.Services Public Class HelloWorld :Inherits WebService     <WebMethod()> Public Function HelloWorld() As String       Return("Hello World")    End Function End Class
end example

click to expand
Figure 14.12: The HelloWorld_WS.asmx class description page

start sidebar
For Further Information

You can utilize hundreds of resources to find out more about ASP.NET. Some of our most-visited ASP.NET- oriented websites are www.asp.net, and www.4guysfromrolla.com. For some great training and reference books such as Mastering ASP.NET, visit www.sybex.com.

end sidebar



Mastering Dreamweaver MX Databases
Mastering Dreamweaver MX Databases
ISBN: 078214148X
EAN: 2147483647
Year: 2002
Pages: 214

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net