In the New to web services tab, you learned what Web services are, and obtained a description of the web services' component technologies. On this tab you'll learn how Information Management fits into the total picture of Web services.

What are Information Management web services?

Information Management web services are web services that are provided by Information Management. These services include SQL operations like inserts, updates, deletes and calling stored procedures against a DB2® UDB database. On the other hand, Information Management can also behave as a web service consumer. For example, let's take a look at Figure 1 below.

Figure 1. Information Management and the web services environment
Figure 1. Information Management and the web services environment

Assume your Canadian company manufactures cars. In order to be competitive you develop an application which polls different vendors in North America for the price of different parts, and chooses the ones that sell the parts at the lowest price at a given time. How does your application poll the different vendors? How do the vendors post the list of parts offered and their prices?

In the example, the vendors are behaving as web services providers. Assuming they store the list of parts and prices (local currency) in a DB2 UDB database, and make them available through DB2, then they are behaving as Information Management web services providers. This is shown on the left side of Figure 1.

The right side of the figure represents your application, which first converts the price provided in local currency to Canadian dollars, using the getRate function (provided by another web service provider) within an SQL statement. Therefore, your application behaves as a Information Management web service consumer.

Another consumer technology that ships with WebSphere Information Integrator is the web services wrapper. Whereas the UDFs model the web service access as SQL functions the web service wrapper models the web service access through virtual tables (NICKNAMEs). See the reference section for more information on the web services wrapper.

What are the requirements to work with Information Management web services?

Information Management as a web services provider requires that the web services Object Runtime Framework (WORF), also known as Document Access Definition Extension (DADx) is installed. WORF is provided as a zip file, dxxworf.zip, and is shipped with DB2 UDB server editions. It can be found in the subdirectory SQLLIB\samples\java\Websphere under the directory where DB2 was installed. WORF is also shipped with WebSphere Information Integrator, WebSphere Studio Version 5 and Rational Application Developer 6.

Information Management as a web services consumer requires that you install the DB2 XML extender and that you enable Information Management web services consumer UDFs. Refer to the article Information Management Web services for Information Management practitioners for details about how this can be done.

How can you work with Information Management as a web services provider?

When DB2 is the web services provider, a web services client application can access a DB2 UDB database through a WSDL interface. You can create a WSDL interface to DB2 data using the capabilities of WORF. In simplified terms, access to DB2 data can be defined using an XML file called the DADx file. This XML file can contain a series of operations. Each of the operations can consist of DB2 stored procedure invocations, XML document storage or retrieval, or CREATE, SELECT, UPDATE, DELETE tasks using SQL statements.

In Listing 1, a single operation called "showemployees" is defined for retrieving all of the data from the employee table within a DB2 database. A DADx file may contain multiple operations. These operations are basically deployed as Web services within a single application module.

The Information Management web services environment (WORF) provides the infrastructure to automatically create the WSDL interfaces for each of your defined operations. WORF generates a web services test client as a web application, using Java servlets and JSPs. The test client can use simple HTTP or SOAP bindings. An HTTP binding is useful for testing a Information Management web service directly using a web browser. The SOAP binding can be used by web services clients to create distributed applications. The data is returned from the Information Management web service as an XML document or as a Java object. XML parsers are readily available for various programming languages, including Java and C.

When you expose Information Management data to web services clients using DADx, consider embedding data access logic into Information Management stored procedures. Information Management stored procedures provide a very powerful technique for creating an abstraction layer for Information Management data access. Information Management stored procedures can be created in various programming languages, including Java and the standard SQL procedure language.

After you have defined operations for Information Management data access with a DADx file, you must deploy the DADx file and its runtime environment (Apache SOAP or Apache axis) to a supported Java™ web application server environment (Apache/Jakarta Tomcat or IBM® WebSphere® Application Server or the DB2 application server).

After you have the Information Management web service tested and deployed, any web services client can start using the Information Management web service. Using WebSphere Application Server to deploy Information Management web services provides additional benefits such as pooled database connections and centralized administration. WebSphere can also be deployed using horizontal and vertical scaling techniques to provide fault-tolerance and high-transaction rates required for a popular Information Management web service.

How can you work with Information Management as a web services consumer?

Information Management behaves as a web services consumer when it invokes a web service through an SQL statement. For example, in Figure 1, a Information Management web service SQL function called getRate("country","country") returns the current currency conversion rate between two countries. Since this data is constantly in flux, a web service provider can supply the most current value for your application. In the example, we are using the power of SQL to calculate the price of a part in Canadian dollars before returning it to the application. By using SQL statements, it is easier to consume and integrate web services data. Using SQL to access web services data can save you effort because data can be manipulated within the context of an SQL statement before it is returned to the client application. A non-Information Management web service client application could achieve this same result without the use of Information Management web service SQL extensions, but it would require more programming effort.

Because these web services are consumed by using SQL statements, it is simple to test the web service access using tools such as DB2's Command Line Processor (CLP). Tools play an important role in accessing web services data from SQL. Converting an existing WSDL interface into a Information Management function (table or scalar) is a task that is simplified using a WebSphere Studio plug-in to convert WSDL to DB2 SQL functions. The tooling capability is also included in WebSphere Studio version 5 and Rational Application Developer 6 and above.

Accessing Web services data directly from DB2 SQL statements does not require a Java application server or the DB2 web service provider. These SQL extensions are created by a DB2 database administrator or database developers. During SQL statement execution, a connection with the Web service provider is established and the response document is returned as a relation table or a scalar value.

Grid computing has adopted Web services as part of the Open Grid Services Architecture, a new model for this type of distributed computing that uses Web services to communicate how the grid operates.

Where can I get more information about Information Management web services?

Learn more about it