Web service development and deployment with Informix Dynamic Server and IBM Data Studio

An integrated data management environment

IBM® Data Studio brings Informix® Dynamic Server (IDS) developers the latest in Web services technology. Learn how this new set of tools makes it easy to design, develop, deploy, and manage your IDS applications. Get started with Web services development using the latest methodology, and also learn how you can simulate a Web service response by converting it to presentable HTML format.

Share:

Shweta Sinha (shwsinha@in.ibm.com), System Software Engineer, IBM 

Shweta Sinha photoShweta Sinha works in the IBM Software Lab, India, as a QA-Engineer in the IDSQA team across various IDS products.



Prasanna Alur Mathada, Informix-Interoperability Team, India Software Lab, IBM

Prasanno Mathada photoPrasanna Mathada is a certified Informix Professional. He currently works for the Interoperability team, ISL, India.



Amitava Chakraborty (amitacha@in.ibm.com), Informix-Interoperability Team, India Software Lab, IBM

Amitava Chakraborty pictureAmitava has more than 8 years of experience on the different informix products. Currently as a lead of Informix Interoperability team he owns the responsibility to ensure Informix scalability to other prime products.



21 February 2008

Also available in Chinese

Introduction

IBM Data Studio V1.1 (Data Studio) is an integrated data management environment for designing, developing, deploying, and managing your data-driven applications. Data Studio contains a new version of the Web Services Object Runtime Framework (WORF), allowing for simple and fast SOA enablement of database operations. It is more a advanced tool, yet simpler to use.

It is compatible with normal database operations such as SQL SELECT, UPDATE, INSERT, and DELETE. It provides a full Web services interface, including SOAP over HTTP, HTTP GET/POST and WSDL. In addition, Data Studio also provides a REST-style service interface. The benefits of Data Studio include fast and easy Web service creation and deployment without requiring any programming.

Design architecture of Data Studio

An IBM Data Studio Web service is hosted inside a J2EE Web application instance. It goes against one database (one data source) and can contain one or more database operations exposed as Web service operations. There are different end point interfaces which act as entry points listening for client requests.

Figure 1. Design architecture of IBM Data Studio
Design architecture of IBM Data Studio

The entire code can be divided into two parts:

  • The common IBM Data Studio runtime
  • Code that is specific to the interface

Runtime architecture of Data Studio

The provider develops a Web service using the tooling, deploys the runtime artifacts, and distributes the WSDL file, while the client generates the SOAP proxy client and executes the Web service request.

The tooling is responsible for assembling, ready to deploy, the IBM Data Studio Web application. It makes use of Query Builder and Database Explorer within Data Studio to generate database operations. The tooling also generates a default type mapping between the SQL statement input and output parameters, and generates appropriate XML schema and WSDL documents describing the input and output messages of the resulting Web service operation.

The XML request document is contained inside the SOAP body element of the SOAP request message. IBM Data Studio can only deal with SOAP messages containing one message part. The default tagged XML input document gets forwarded to the common IBM Data Studio code where the actual database operation gets prepared and executed. Depending on the used endpoint interface, the XML document gets either directly shipped back to the caller (REST) or it gets packed into a SOAP message (WAS/Axis SOAP engine).

Figure 2 below illustrates the runtime architecture:

Figure 2. Runtime architecture of Data Studio
Runtime architecture of Data Studio

Input - output flow

  • Input
    • URL-encoded parameters
      • No Web service, REST-style access only
      • No customization
    • XML request document
      • XML message in SOAP Body and XML POST (if exposed as REST) must follow the same schema!
      • Can be influenced by using XSLT to customize it
  • Output
    • XML response message
      • Message in SOAP response Body and in HTTP XML response (if exposed as REST) will follow the same XML schema
      • Can be influenced by using XSLT to customize it
    • TEXT or HTML
      • No Web service, REST only
      • XSLT required to transform XML output into HTML or TEXT

Supported database operations for IDS

  • Query:

    Query is an operation that may have input parameters and that returns a result set.
  • Update:

    Update is an INSERT, UPDATE, DELETE, or MERGE operation that may have input parameters and that returns an integer (number of affected rows).

Configuration of IBM Data Studio with IDS

This section describes how to configure Data Studio for connecting to IDS. Please refer to the IBM Data Studio Information Center for details on how to configure other supported data servers.

Create a connection pool for your Informix database

Follow these steps to create a connection pool:

  • Open the Database Explorer by clicking on Window -> Open Perspective -> Other -> Data
  • Open the new connection wizard by right clicking on the node Connection in the Database Explorer window.
  • For IDS v9.x and v10 users, choose the option Informix JDBC Driver from the dropdown menu labeled JDBC Driver. Also make sure you mention both jdbc.jar and jdbcx.jar while browsing the Class location.
  • For IDS v11 users, choose the option IBM Data Server Driver for JDBC and SQLJ from the dropdown menu labeled JDBC Driver.

Figure 3 illustrates the remaining configuration parameters.

Figure 3. JDBC configuration
JDBC configuration

When you click on Next from the screen shown in Figure 3, you will get a new window where you can specify the choices shown in Figure 4 below. Click on Finish after completing the steps.

Figure 4. Specifying the filter
Specifying the filter

Create a Data Development Project and attach the database connection

Follow these steps:

  1. Click on File -> New -> Data Development Project. Enter the name of your project, and click on Next.
  2. This will open a new window where an existing or a new database connection can be attached to this project. Choose your database, and click on Finish to complete the creation of the project.

The new project can be seen in the database project explorer window, shown in Figure 5. For an Informix database connection, this project will have only an SQL Scripts folder along with a Web Services and an XML folder. There will not be any stored procedure or user-defined function folders available, as these facilities are not available for an Informix database connection.

Figure 5. Informix project in IBM Data Studio
Informix Project in IBM Data Studio

Add the Web servers to the Data Studio framework

Follow these steps:

  1. Select File -> New -> Other -> Server -> Next.
  2. This will open a new window where all the Web servers available for deployment will be avialable. You can choose the Web server accordingly. IBM Data Studio currently supports WebSphere Application Server 6.1 and WebSphere Application Server Community Edition 1.1 for direct deployment of Web services to the application server.

    WebSphere Application Server Community Edition will not be listed when this explorer is opened the first time. You must add the plug-ins for WebSphere Application Server Community Edition by clicking the link labeled Don't see your server listed? Click here.

  3. After clicking the Next button, a new window opens where you can specify the required information for the Web server you have selected.
  4. Click the Finish button to add the desired Web server. The new server will be listed in the Server tab at the bottom section of the IDE.
  5. You can then start the application server by choosing the Start button available when you right click on the server.

Create SQL statements

Follow these steps to create SQL statements within your application:

  1. From the Data Project Explorer window, under the project, right click on the SQL Scripts folder and select the New option.
  2. This will open a new window where you can name your SQL scripts with the choice of SQL Builder or SQL Editor.
  3. Select the Finish button after these tasks are completed.
  4. Depending upon your choice of SQL Builder or SQL Editor option, the IDE will either open a query builder wizard or an SQL editor to build the required query. Follow the prompts to build your statement. Syntax checking as well as sample execution options are also avalible under this facility.
  5. Save the SQL after it is completed.

Create Web services

Follow these steps to create Web services:

  1. In the Data Project Explorer window, under the project, right click on the Web Services folder and select the New option.
  2. This will open a new window where you can name the Web service. Select Finish after the naming is completed.
  3. Now drag the previously created SQL scripts to this new Web service created under Web services folder. In this way, your can add all the SQL scripts under the Web service you have created.

Deploy the Web services on the Web servers

Follow these steps to deploy the Web services you have created:

  1. In the Data Project Explorer window, under the project, right click on the Web Services folder and select the Deploy option. This will open a new window where you can specify the Web server on which the Web service will be deployed.
  2. Change the value of Artifact.contextRoot to be the same as the Web service you have created.
  3. Also choose the Launch Web Services Explorer after deployment as well as Register Database Connection with Webserver options.
  4. When this is completed, select Finish. This will deploy the Web services on the Web server that you specified.
  5. Once the deployment is successfully completed, you can access the Web services through the URL in any Web browser:
    http://<Host>:<port>/<Web Service name>/rest/<Web Service name>/<SQL Script Name>

Note : IBM Data Studio V 1.1 supports only SQL scripts on Informix. There is no support for stored procedures or user-defined functions. The Data Development Project for IDS connection will only show the SQL Scripts option.

Managing XSLT on deployed Web services

You can attach XSLT features to the Web services either at the Web server end or while calling the Web services, to convert the XML data to a non-XML format, such as HTML.

XSL can be attached to a Web Service when it is deployed by using the Manage XSLT option. Access this option from the Data Project Explorer window, when you right-click the operation under Web service. The options are available to attach XSL both as an input parameter as well as output converter for that Web service. Figures 6 and 7 illustrate this process.

Figure 6. Manage XSLT
Manage XSLT
Figure 7.Attach XSL
Attach XSL

XSL also can be used while calling the Web service from GET/POST method to convert the Web service output from XML to HTML format. In the Downloads section, we have included an example of such an application.

Conclusion

This article introduced you to the process of configuring IBM Data Studio with IDS and also for publishing your Java™ applications easily in the form of Web services. Download Data Studio to try out the techniques we've described and implement it in your own environment.


Downloads

DescriptionNameSize
HTML Form calling the Web Service1BYORDERNUM.html2KB
StyleSheet which parse the XML2order.xsl3KB
This file converts the XML output3BYORDERNUM.jsp2KB

Notes

  1. This is an HTML form calling a Web service.
  2. Stylesheet that parses the XML from the Web Service.
  3. This file internally parse the XML output through XSL and returns HTML

Resources

Learn

Get products and technologies

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

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

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



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.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

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

 


All information submitted is secure.

Dig deeper into Information management on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Information Management, SOA and web services
ArticleID=290720
ArticleTitle=Web service development and deployment with Informix Dynamic Server and IBM Data Studio
publish-date=02212008