Before you start
Web services provide access to distributed applications. They are increasingly used to integrate information processing within and between enterprises. When building service-based applications, Web services often need to be integrated with relational data. To accomplish this, applications must access both Web services and database management systems.
The Web services consumer converts existing WSDL interfaces into DB2® table or scalar functions. Web service consumer User Defined Functions (UDFs) can enable databases to directly invoke Web services using SQL. By using SQL to access Web Services data, you save effort because you can manipulate the data within the context of an SQL statement.
You might think using these Web service consumer UDFs in SQL statements could be time consuming or require advanced programming skills. This tutorial will show you otherwise. It will guide you through the steps to:
- Enable your database for Web Service consumer UDFs
- Create Web service consumer UDFs using WebSphere® Studio Application Developer wizard
- Create Web service consumer UDFs using the DB2 command line
After generating and deploying the UDFs, they can be used by application programs to combine relational data with dynamic data retrieved from the Web service.
Examples are given to show how to use the UDFs in SQL statements. This tutorial assumes basic knowledge of Web services, DB2 SQL, and WebSphere Studio Application Developer V5.1.1. If you are not familiar with Web services, or you could use a refresher, developerWorkshas an excellent introductory tutorial on Web services (see Resources ).
To complete the steps in this tutorial, you'll need the following software installed and running:
- DB2 Universal Database V8.1 FixPack 4
- WebSphere Studio Application Developer V5.1.1. This is optional - you can use the DB2 command line but Application Developer makes it much easier.
A free trial version DB2 Universal Database® V8.1 is available from the developerWorks download page.
This tutorial has been revised from one originally created by Marcus Schneider and Dan Wolfson (IBM Distinguished Engineer).
Copyright, 2003 International Business Machines Corporation. All rights reserved.
IBM, DB2, DB2 Universal Database, DB2 Information Integrator, WebSphere and WebSphere MQ are trademarks or registered trademarks of IBM Corporation in the United States, other countries, or both.
Other company, product, and service names may be trademarks or service marks of others.

