Seven Steps to XML Mastery, Step 5: Making Web Services Work for You (Part 2 of 2)
In part 1 of step 5, we explored how to obtain XML data from Amazon’s web service and turn that information around, to create a ZwiftBooks price-and-time web service. Now let’s look at how to use Web Services Description Language (WSDL) to describe that web service, so that any client computer can connect to and obtain quotes from our ZwiftBooks web service.
What Is WSDL?
WSDL is an XML vocabulary for describing web services in sufficient detail that a program can construct another program to do the following (see Figure 1):
- Connect to the web service at some server location.
- Deliver input data in whatever format the web service requires.
- Decode whatever data the server delivers as its web service.
Figure 1 WSDL describes that nature of the computer-to-computer web services conversations.
The WSDL 2.0 specification was officially adopted in January 2006 as a W3C Candidate Recommendation. This means that it’s just about ready for final approval, pending feedback from vendors about its implementability and how interoperability from different vendors stacks up.
Because WSDL is XML, it’s possible for various languages and platforms to build tools around it. For example, WSDL can be imported into .NET, converted into Java code using Apache Axis, or used directly by Perl SOAP::Lite.
The WSDL vocabulary describes a web service through a series of elements that specify the service and describe how to connect to it (see Figure 2).
Figure 2 WSDL elements