Before you start
This tutorial is designed to give you an understanding of Web Services Description Language. It is for developers who wish to expose their own services for use by others using WSDL, and also for developers who have the WSDL file for a service they wish to access, and need to create a client.
In order to follow along with this tutorial, you should have a basic understanding of SOAP, which you can achieve by reading Part 1 of this tutorial series, and by extension, a basic understanding of XML. WSDL is programming language agnostic, but the samples at the end of the tutorial use Java and the Apache Axis2 project. The concepts, however, apply to any programming language and environment. Similarly, the tutorial focuses on the more commonly implemented WSDL 1.1, but the concepts are the same for the upcoming WSDL 2.0, and it covers the basic differences.
This tutorial series teaches the basic concepts of web services by following the exploits of a fictional newspaper, the Daily Moon, as the staff uses web services to create a workflow system to increase productivity in these turbulent times.
Part 1 starts simply, explaining the basic concepts behind web services and showing you how to use SOAP, the specification that underlies most of what is to come, connecting the Classifieds Department with the Content Management System.
In Part 2, the Classifieds Department takes things a step further, using Web Services Description Language (WSDL) to define the messages produced and expected by their own web service, enabling the team to more easily create services and the clients that connect to them.
Part 3 finds the team with a number of services in place and a desire to locate them easily. In response, Universal Description, Discovery and Integration (UDDI) provides a searchable registry of available services as a way to publicize their own services to others.
Parts 4 and 5, WS-Security and WS-Policy, got a goal being securing of the paper's services and the changes the teams need to make in order to access those newly secured services.
Interoperability is the key word in Part 6, as services from several different implementations must be accessed from a single system. Part six covers the requirements and tests involved in WS-I certification.
Finally, Part 7 shows how to use Business Process Execution Language (WS-BPEL) to create complex applications from individual services.
Now let's look at what this tutorial covers in a bit more detail.
Part 1 of this series, Understanding web services: SOAP, introduced the staff of the fictional Daily Moon newspaper. Specifically, you met the Classifieds Department. In that tutorial, the Classifieds Department built a client to send SOAP messages back and forth to the web service representing the Content Management System. In this tutorial, the Classifieds Department, impressed by what they saw, decides to build their own web service to take and manage ads in the classifieds database. In order to allow others to use the service, however, they will need to create a Web Services Description Language (WSDL) file. This file gives instructions to those building clients so that they know what messages the service expects and returns.
In this tutorial, you'll learn the following:
-
Why WSDL files are important
-
What you can do with WSDL files
-
The basics of XML schema, which figure into WSDL files
-
How to structure a WSDL file
-
The basic differences between WSDL 1.1 and WSDL 2.0
-
How to automatically generate a WSDL file from a Java class that represents a service
-
How to generate a Java class that represents a service from a WSDL file
-
How to generate a web service client from a WSDL file
The Classifieds Department will build a service that takes new ads, edits and displays existing ads, and finalizes an issue so that it no longer accepts any more ads. They will use both request/response and one-way messaging.
The bulk of this tutorial is conceptual, but in order to follow along with the code towards the end of this tutorial, you will need to have the following software available and installed:
Apache Geronimo or another application server -- The team creates a new web service in the course of this tutorial, and you will need an application on which to run it. Because web services are, of course, supposed to be interoperable, it doesn't really matter which one you use. This tutorial demonstrates the use of Apache Geronimo, which is also the basis for IBM's WebSphere Community Edition. You can also use other application servers such as WebSphere application server. You can download Apache Geronimo from http://geronimo.apache.org/downloads.html. For more information on installing Geronimo, see the first tutorial in this series, "Understanding web services specifications, Part 1: SOAP."
Apache Axis2 version 0 .95 or higher -- You can create SOAP messages by hand, and you can interpret them by hand, but it's much easier to have an implementation handy. This tutorial demonstrates the use of Apache Axis2, which contains implementations of various SOAP-related APIs to make your life significantly easier. You can download Apache Axis2 at http://ws.apache.org/axis2/download.cgi. This tutorial uses version 0.95, but later versions should work. (Note that Part 1 of this series used version 0.94, but it has not been tested with the code in this part.)
Java 2 Standard Edition version 1.4 or higher -- All of these tools are Java-based, as are the services and clients you'll build in this tutorial. You can download the J2SE SDK from http://java.sun.com/j2se/1.5.0/download.jsp.
You'll also need a Web browser and a text editor, but I'm sure you already have those. If you like, you can also use an IDE such as Eclipse, but because we're focusing on the technologies rather than tools, we'll just be using a text editor and the command line to edit our files and compile them.


