Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Understanding web services, Part 2: Web Services Description Language (WSDL)

Sharing web services

Photo of Nicholas Chase
Nicholas Chase has been involved in Web site development for companies such as Lucent Technologies, Sun Microsystems, Oracle, and the Tampa Bay Buccaneers. Nick has been a high school physics teacher, a low-level radioactive waste facility manager, an online science fiction magazine editor, a multimedia engineer, an Oracle instructor, and the Chief Technology Officer of an interactive communications company. He is the author of several books, including XML Primer Plus (Sams).

Summary:  The current emphasis on Service-Oriented Architectures (SOA) has put the spotlight on web services, but it's easy to get lost in all the information being bandied about. This series gives you the straight story on all of the major web service specifications, starting with Simple Object Access Protocol (SOAP) and working down to WS Business Process Execution Language (WS-BPEL). In this second installment, you'll learn about Web Services Definition Language, as the Daily Moon Classified Department uses WSDL to describe their own web service in such a way that others can easily create clients to access it from any programming language or platform.

View more content in this series

Date:  07 Jul 2006
Level:  Intermediate PDF:  A4 and Letter (153 KB | 58 pages)Get Adobe® Reader®

Activity:  18593 views
Comments:  

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.

About this series

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.


About this tutorial

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.


Tools and Prerequisites

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.

1 of 10 | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=SOA and Web services
ArticleID=145033
TutorialTitle=Understanding web services, Part 2: Web Services Description Language (WSDL)
publish-date=07072006
author1-email=ibmquestions@nicholaschase.com
author1-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.