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]

Transform Data Web Services messages using XSLT in IBM Data Studio Developer

How to use the XSLT feature in Data Web Services to customize input and output Web service messages

Michael Schenker, Software Engineer, IBM
Author Photo: Michael Schenker
Michael Schenker is a software engineer at IBM's Silicon Valley Laboratory in San Jose, Calif. He joined IBM in 2002 and works in the IBM Data Server Tooling area. His subject of expertise is the Web service enablement of IBM's data servers. He holds a Master's degree in computer sciences from the University of Applied Sciences in Leipzig, Germany.
Kavitha Pullela (kpullela@us.ibm.com), Software Development Engineer, IBM
Author Photo: Kavitha Pullela
Kavitha Pullela is a software development engineer working in the Data Web Services Group at IBM's Silicon Valley Lab in San Jose, Calif. She joined the group in November 2007 and works in the IBM Data Server Tooling area. Her areas of interest are Web Service enablement of IBM's database servers, XML, JAVA, and databases. Kavitha Pullela has a Bachelor's Degree in EE and a Master's Degree in Computer Science from UT, Dallas and has worked at Cisco Systems, Hewlett Packard, and Silicon Graphics prior to joining IBM.

Summary:  IBM® Data Web Services is a part of IBM Data Studio Developer, the new unified tooling platform for IBM database servers. Data Web Services can be used to expose database operations and stored procedures as Web services without programming. You can further customize the messages that client applications send and receive from Web Services. This tutorial shows you how to apply XSL transformations to input and output messages to enable a variety of clients.

Date:  31 Jul 2008
Level:  Intermediate PDF:  A4 and Letter (3821 KB | 90 pages)Get Adobe® Reader®

Activity:  7092 views
Comments:  

Before you start

Learn what to expect from this tutorial, and how to get the most out of it.

Introduction

A powerful feature of Data Web Services is the capability to apply server-side XSL transformations to Web service requests and responses. This feature allows you to customize the format of the messages that the client sees. This is particularly useful in cases where enterprise or industry Web service format requirements dictate what the Web services messages should look like.

Data Web Services has a default message format when it comes to Web service request and response messages. The message format and the XML tag names in those messages depends on the Web service operation name, result set column-names, and so on. In some cases, you may not want the client to see the default tag names, either due to message format requirements, or because you simply want to mask the default tag names. Using the server-side XSLT feature, incoming XML requests and outgoing results can be made to look different than the Data Web Services default message format.

In general, Web services can be built using either a top-down or bottom-up approach. In a top-down approach, you start with a service specification (for example, a WSDL file) and then implement the underlying code to match that specification. In a bottom-up approach, you start with a Java bean or SQL statement and expose the functionality as Web services. Using the Data Web Services, you start with the DML operations (for example, queries) and expose them as Web services. Therefore, the development style is typically bottom-up. However, by applying XSLT to the service messages, in many cases, you can map the service format of the bottom-up style messages to the top-down design. This alleviates some of the top-down service format requirements while allowing you to develop bottom-up Web services. The transformation can also be used to deliver data to the client in human readable formats such as HTML, JSON, RSS feeds, or any text format that can result from an XSL transform.

This tutorial introduces you to creating and deploying IBM Data Web Services on an application server and also gives an in-depth overview of how to use the XSLT feature to customize the input and output messages of a sample Web service to fit into your custom XML schema.


Figure 1. Customizable delivery formats - Applying XSLT
Customizable delivery formats - Applying XSLT

Objectives

In this tutorial, you will learn:

  • To use the XSLT feature that is now part of Data Web Services.
  • To generate a default schema for a sample Web service.
  • To apply Web-style transformations to display the output in HTML, JSON, and RSS formats.
  • To apply your custom schemas to SOAP messages.

Prerequisites

This tutorial is written for database programmers who are familiar with IBM Data Studio and know how to perform common tasks such as creating a database connection, a data development project, and SQL scripts or stored procedures. If you are not already familiar with these tasks, you should first complete the tutorial "IBM Data Studio: Get started with Data Web Services" (developerWorks, November 2007). Basic knowledge of XSLT, XSD, and XPath is recommended. Because the examples in the tutorial are all based on WebSphere® Application Server Community Edition server as the target environment, the tutorial assumes that the reader has Data Studio Developer 1.2 installed along with a WebSphere Application Server Community Edition server instance, and a connection to the DB2 SAMPLE database has been set up.


System requirements

To run the examples in this tutorial, you need:

1 of 11 | 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=Information Management, SOA and Web services, XML
ArticleID=325730
TutorialTitle=Transform Data Web Services messages using XSLT in IBM Data Studio Developer
publish-date=07312008
author1-email=mschenk@us.ibm.com
author1-email-cc=
author2-email=kpullela@us.ibm.com
author2-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.