Hello everyone - first let me introduce myself. I joined the Data Studio development team more than 2 years ago and since then I've been working on the Data Web Services capability. During that time I gained a lot of knowledge about connecting database assets to the Web, Java and J2EE development as well as XML processing ... until one day a strange blue box named "DataPower" crossed my way. This blog is about the results of this encounter ...
Information as a Service
A lot has been said about making your data accessible to an SOA environment, the Web, the Cloud, and so on... and IBM, as well as other vendors, provides a wide variety of software tools and frameworks to make all that possible.
But let's look at a common case where data is represented as XML and stored in a relational database:
Very often data is represented as XML messages which flow over the wire. The XML may contain data which comes from, or is going to be written to, a database. It may also contain data and metadata to perform remote procedure calls (RPC) as we see with SOAP. There might be complex business logic at the remote server associated with a message flow - for example in form of a stored procedure in DB2 - but we may also just have a simple mapping from XML into relational structures, or we may just store the XML "as-is" in the database - thanks to the pureXML capabilities in DB2.
The bottom line is that there are many cases where you need nothing else but a simple mapping definition from XML to an SQL statement or a stored procedure call, and another mapping definition to map result sets and output parameters to XML structures.
Make it fast and secure with WebSphere DataPower Appliance
And there are again many approaches on how such a mapping and network wiring can be done, but today I want to introduce you to a fairly new way of doing that by using the IBM WebSphere DataPower Integration Appliance XI50. Because DataPower has - among many other features - the capability of connecting to databases, which includes superior support for DB2 on all platforms.
DataPower allows you to define mappings from XML to database calls via XSL. Furthermore, you can define message flows, network protocol endpoints, security, quality of service properties, WS-* features and much, much more via the award-winning Web GUI interface. And all that without writing a line of code or even code generation! Everything is well contained and controlled inside the DataPower appliance without the need of changing your database server, your legacy data or your application/business logic contained in stored procedures.
Scenario 1: Enrich messages with database content
In this case, messages passing through a DataPower appliance can be enriched with data stored in a database. It's also possible to write parts of or the complete message into the database - for example using the database as an audit log.
Scenario 2: DataPower as an SOA Gateway
Here we declare the database as the target for the message flow. The message data can be stored into or retrieved from the database, or more complex business logic can be invoked in form of a stored procedure.
Scenario 3: High-performance batch INSERT with DB2
DataPower supports the DB2 batch INSERT feature which can speed up the insertion of multiple records into the database. This can be leveraged for XML shredding. You can easily break up a large XML document into multiple records (rows) by defining the shredding rules in your XSL script. The batch INSERT takes care of writing the individual records quickly into the database.
Find out more in this developerWorks article on "Using WebSphere DataPower SOA Appliances to enable the Information as a Service pattern".
The native DataPower XML processing stack provides you wire-speed XML parsing, validation and transformation. DataPower supports a wide variety of different network protocols which allows connectivity to many different back-end and front-end systems - but at the same time you can be sure that your data is kept safe and reliable with the many security capabilities provided with the appliance.
Last but not least, a well designed management API as well as connectivity to registries like the WebSphere Service Registry and Repository (WSRR) allows easy life-cycle management of your artifacts.
Make it even easier by using IBM Data Studio Developer
At this point you may say - "All that sounds great, but why in the world is he posting this in the Data Studio blog?".
Well, you may already be familiar with the Data Web Services feature in Data Studio Developer (if not, see links below) where you can easily expose stored procedure calls and SQL statements as Web service operations by creating the appropriate J2EE runtime artifacts. But did you know that you can now also create service runtime artifacts for DataPower? The Data Studio Developer tooling generates all artifacts for a Data Web service - including the WSDL file and - in case of DataPower - the XSL scripts which perform the mapping from the XML message into database calls. There is no need to code the XSL by hand. All that's left do to is the deployment of the artifacts on the DataPower appliance.
I wrote a tutorial on this topic to show you how easy it is to use Data Studio Developer to create the Data Web service artifacts and how to configure DataPower to host the generated services. Check it out.
To get some more ideas on using DataPower and DB2 pureXML I recommend the following two articles:
- XML schema and content validation using WebSphere DataPower and DB2 pureXML
- DB2 pureXML as an audit log for WebSphere DataPower
WebSphere DataPower SOA Appliances on DeveloperWorks
Data Web services in Data Studio Developer
- There is a Redbook on "DB2 9 for z/OS: Deploying SOA Solutions" which covers more Data Web service scenarios including Data Studio Developer, DataPower, the DB2 Web service consumer functions and much more.
- Overview article on IBM Data Studio and Data Web Services
- Video by Michael Pauser on channeldb2