White Papers
Abstract
This article shows you how to get started using the WebSphere Transformation Extender Design Studio with WebSphere DataPower SOA Appliances. The article describes WebSphere Transformation Extender and its integration with DataPower, and uses examples to show you how to design transformation maps for the DataPower Appliance.
Content
IBM WebSphere DataPower SOA Appliances provide an array of functionality in purpose-built and easily deployable devices. Several versions of the DataPower Appliances provide different levels of functionality. DataPower XML Accelerator XA 35 provides XML, schemas, XPath, and XSLT processing. DataPower XML Security Gateway XS40 adds firewall, encryption, and access control. DataPower Integration Appliance XI50 further adds ESB functionality, including message routing and transformation. Using WebSphere Transformation Extender Design Studio to develop transformations for DataPower Appliances is a natural extension of the platform. DataPower Appliances support high-performance XML-to-XML transformation on the device that uses XSLT. WebSphere Transformation Extender provides support for XML-to-Binary or Binary-to-XML transformation on the appliance without having to write any XSLT. As in the standalone product, writing transformations is as simple as using the Design Studio graphical user interface to define inputs and outputs and then map between them. This article shows you how to create several maps in the WebSphere Transformation Extender Design Studio and then run them on a DataPower Appliance. To follow the samples included with this article, you need to have the following products installed: See the product documentation for information on operating system and hardware requirements. Creating transformations that uses WebSphere Transformation Extender Design Studio is a simple process. A primary benefits of using this product is that understanding the process of creating transformations in the standalone version of WebSphere Transformation Extender lets you leverage those transformations to create transformations targeted for DataPower. The first step in creating a transformation is to define a type tree, which is a WebSphere Transformation Extender artifact that is the data dictionary for what you want to transform. It is a schema-like representation of the data that enables WebSphere Transformation Extender to perform validation on inputs and outputs. There are various ways to create type trees depending on what your data are. WebSphere Transformation Extender provides a set of importers that automate this process, as explained below. These importers include XML schemas, DTDs, COBOL copybooks, CORBA IDL Files, and others. If you want to define your input data yourself, you can use the Type Designer graphical tool, which lets you specify what fields your data contains, how it is delimited, and any type validation you want to perform. Type trees are not tied to an input or output direction and can be reused extensively. They simply tell WebSphere Transformation Extender what type of data to expect to ensure that everything you transform is valid. Once you have defined all of the type trees you transform, it’s time to start mapping. WebSphere Transformation Extender Design Studio provides a graphical tool called Map Designer that makes this process simple. First, you create a map source file with a .mms extension, which is a physical artifact that contains all the mappings that you might perform. Next you create an individual map -- map source files can contain many maps, but for the purposes of this article we limit it to one. Each map has input and output cards. WebSphere Transformation Extender allows multiple inputs and outputs, so you can read from various sources and write out to various places within the context of a single map. When creating an input card, the most important setting is the card name. After you define your input and output cards, mapping is as easy as dragging from an input to an output field. To perform more complex functions, WebSphere Transformation Extender provides built-in functions for tasks such as converting your data, performing mathematical operations on it, or manipulating strings. When you have mapped all the output fields, you are ready to build your map and run it, which you do from within the Map Designer tool. Now that you understand the concepts involved in creating WebSphere Transformation Extender type trees and maps, you can run some actual maps. Start with a simple "Hello World" map and then progress to a more realistic example. Start by loading and running a simple WebSphere Transformation Extender map, first using the WebSphere Transformation Extender engine and then moving to DataPower: You successfully ran the sample map using the WebSphere Transformation Extender engine. Setting up this map to run on DataPower is very simple. You have now taken a simple map and shown how easy it is to run it on both the WebSphere Transformation Extender runtime engine and the DataPower runtime engine. The next step is a more real-world example. One of the most powerful use cases for using the WebSphere Transformation Extender Design Studio with DataPower is connecting your legacy applications with new services that can consume XML. The Design Studio makes this simple and lets you retain the benefits of using the DataPower Appliance. In this example, you read in XML data and write it out in COBOL copybook format. The data involves a simple purchase order. Here is the schema: This schema defines the PurchaseOrderType object, which contains information about the order as well as a shipTo address made up of several fields. Here is the input data that corresponds to that schema: The output is a COBOL copybook with the following structure: The first step in creating this solution is to create the type trees. First, import the purchase_order.xsd file using the WebSphere Transformation Extender Schema Importer: Next, perform similar steps to create the type tree for the copybook. You have now defined inputs and outputs and are ready to complete the map. The previous examples showed how to build type trees and maps that can be used on DataPower. Previous users of WebSphere Transformation Extender is note that certain functions are restricted on the DataPower runtime. To simplify the process for users, the Map Designer performs a check at build-time to make sure no restricted functions are contained in the map. A full list of these restrictions is provided in the WebSphere Transformation Extender Design Studio documentation. This article showed how to get started creating type trees and maps using WebSphere Transformation Extender Design Studio and deploying them on WebSphere DataPower SOA Appliances. DataPower Appliances provide powerful functionality that is amplified when used with WebSphere Transformation Extender Design Studio.Introduction
Prerequisites
WebSphere Transformation Extender Design Studio
Creating type trees
Creating maps
Building and running WebSphere Transformation Extender maps on DataPower
Running a "Hello World" map on DataPower
Creating an XML-to-COBOL map
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="purchaseOrder" type="PurchaseOrderType"/> <xsd:complexType name="PurchaseOrderType"> <xsd:sequence> <xsd:element name="item" type="xsd:string"/> <xsd:element name="item_count" type="xsd:int"/> <xsd:element name="shipTo" type="USAddress"/> </xsd:sequence> <xsd:attribute name="orderDate" type="xsd:date"/> </xsd:complexType> <xsd:complexType name="USAddress"> <xsd:sequence> <xsd:element name="name" type="xsd:string"/> <xsd:element name="street" type="xsd:string"/> <xsd:element name="city" type="xsd:string"/> <xsd:element name="state" type="xsd:string"/> <xsd:element name="zip" type="xsd:decimal"/> </xsd:sequence> <xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/> </xsd:complexType> </xsd:schema>
<?xml version="1.0"?> <purchaseOrder orderDate="1999-01-21" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="po_2.xsd"> <item>Widget</item> <item_count>15</item_count> <shipTo country="US"> <name>John Doe</name> <street>123 North St</street> <city>Miami</city> <state>FL</state> <zip>33175</zip> </shipTo> </purchaseOrder>
000010 01 PURCHASE_ORDER. 000020 02 ITEM PIC X(30). 000030 02 ITEM_COUNT PIC S9(10). 000040 02 NAME PIC X(30). 000050 02 STREET PIC X(30). 000060 02 CITY PIC X(30). 000070 02 STATE PIC X(30). 000080 02 ZIP PIC S(11).
Tips for using WebSphere Transformation Extender Design Studio with DataPower
Conclusion
Product descriptions, product news, training information, support information, and more.
Product announcements, case studies, white papers, and more.
Was this topic helpful?
Document Information
Modified date:
08 June 2021
UID
ibm11109331