Db2 as a web services consumer and provider

Web services are a set of resources and components that applications can use over HTTP. You can use Db2 as a web services provider and a web services consumer.

Db2 as a web services consumer

Db2 can act as a client for web services, which enables you to be a consumer of web services in your Db2 applications.

SOAP web services Simple Object Access Protocol (SOAP) is an XML protocol that consists of the following characteristics:
  • An envelope that defines a framework for describing the contents of a message and how to process the message
  • A set of encoding rules for expressing instances of application-defined data types
  • A convention for representing SOAP requests and responses
A set of SOAP functions is provided by Db2 and is installed and configured when you install or migrate Db2.

REST web services The Representational State Transfer (REST) protocol provides access to web-based content directly from SQL statements through HTTP requests. A set of basic sample REST user-defined functions can be installed with Db2. These functions provide access to web-based content through the HTTP GET, POST, PUT, and DELETE methods.

Db2 as a web services provider

You can enable your Db2 data and applications as web services through the Web Services Object Runtime Framework (WORF). You can define a web service in Db2 by using a Document Access Definition Extension (DADX). In the DADX file, you can define web services based on SQL statements and stored procedures. Based on your definitions in the DADX file, WORF performs the following actions:
  • Handles the connection to Db2 and the execution of the SQL and the stored procedure call
  • Converts the result to a web service
  • Handles the generation of any Web Services Definition Language (WSDL) and UDDI (Universal Description, Discovery, and Integration) information that the client application needs