Web Services: The Big Picture

Team-Fly    

 
.NET and COM Interoperability Handbook, The
By Alan Gordon
Table of Contents
Chapter Ten.  XML Web Services

Web Services: The Big Picture

Before I look at how the .NET Framework and Visual Studio .NET help you to develop Web services, let's look at the constituent elements of an XML Web service at a very generic level. Remember, XML Web services are not strictly a .NET technology. The .NET Framework and Visual Studio .NET were designed to make it easy to develop XML Web services, but you can build an XML Web service on any platform that supports HTTP and XML.

A Web service is composed of a SOAP/HTTP listener, one or more classes that implement the Web service's business logic, and a metafile for the Web service that you can write with WSDL (see Figure 10-1).

Figure 10-1. An XML Web service.

graphics/10fig01.gif

The SOAP/HTTP listener reads the SOAP requests sent through HTTP or some other standard Internet protocol. The listener can be an Active Server Page, an Internet Services API (ISAPI) DLL, or, in the case of .NET, an HTTP handler, which is the ASP.NET equivalent of an ISAPI DLL. The listener parses the XML-based SOAP request and makes the desired call on the object(s) that implement the Web service's business logic. These objects can be .NET components , COM objects, CORBA objects, or enterprise JavaBeans. In fact, you could implement the Web service's business logic directly in the listener.

The metafile contains a complete description of the methods that are supported by the Web service, including the name and type of each argument and the return value for each method. This metafile is encoded in an XML-based language called WSDL. The WSDL metafile associated with each XML Web Service allows users to determine the capability of a Web service. It also allows development tools to generate a proxy automatically to call the Web service. This prevents users from doing the grunt work of formatting an HTTP request and parsing the response in order to call the Web service.

You can think of WSDL as the Web service's equivalent of COM IDL. The WSDL metafile associated with a Web service is the equivalent of a COM type library. Visual Studio .NET uses the information in the WSDL file to generate a proxy, which makes it simple for clients to call a Web service. If you don't have Visual Studio .NET, the .NET Framework SDK contains a utility called the Web Services Description Language Tool (wsdl.exe), which can read a WSDL file and create a proxy. See the following URL for an excellent explanation of XML Web services, SOAP, WSDL, and UDDI: msdn.microsoft.com/ webservices /understanding/webservicebasics/default.asp.

Microsoft has also defined a discovery mechanism (an XML schema and a search algorithm) called Web Services Discovery Tool (DISCO) that allows a user to discover the XML Web Services that are deployed at a particular URL. There is also an industry-wide movement afoot to create an online directory of Web services. These online directories will allow users to look up a Web service by company name (like the white pages in your telephone directory), by category (think of the yellow pages in your telephone directory), or by technical specification. These online directories are themselves Web services, which use a specification called UDDI. As with a phone directory, you can search for a company that offers the Web services you need, read about the Web service offered (including how you will be charged to use the service), and, if you so choose, immediately locate the Web service and start using it. You can find out more information about UDDI at uddi.org/about.html.

Note

Both Microsoft and IBM currently have UDDI Repositories up and running. See the following URLs to learn more: uddi.microsoft.com and www-3.ibm.com/services/uddi. While writing this chapter, I went to the Microsoft UDDI repository and found several interesting XML Web services that, among other things, verify credit card numbers ; perform currency conversions; provide stock quotes; track UPS packages online; and provide shopping cart, ordering, and order history functionality. My personal favorite, though, was an XML Web service that provides weather information (including temperature, humidity, wind direction and speed, and sunrise and sunset times) based on your ZIP code. You can find this Web service at glkev.net.innerhost.com/glkev_ws/WeatherFetcher.asmx.



Team-Fly    
Top
 


. Net and COM Interoperability Handbook
The .NET and COM Interoperability Handbook (Integrated .Net)
ISBN: 013046130X
EAN: 2147483647
Year: 2002
Pages: 119
Authors: Alan Gordon

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