BEA Logo BEA WebLogic XML/Non-XML Translator 1.0

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   WebLogic XML/Non-XML Translator Doc Home   |   BEA WebLogic XML/Non-XML Translator User Guide   |   Previous Topic   |   Next Topic   |   Contents   |   Index

BEA WebLogic XML/Non-XML Translator Overview

 

Within most enterprise application integration (EAI) problem domains, data translation is an inherent part of an EAI solution. XML is quickly becoming the standard for exchanging information between applications, and is invaluable in integrating disparate applications. However, most data transformation engines do not support translations between binary data formats and XML. BEA WebLogic XML/Non-XML Translator (hereafter referred to as XML Translator) provides for an exchange of information between applications by supporting data translations between binary formats from legacy systems and XML.

This section provides information about the following topics:

 


Understanding XML Translation

Data that is sent to, or received from, legacy applications is often platform-specific binary data that is in the native machine representation. Binary data is not self-describing, so in order to be understood by an application, the layout of this data (metadata) must be embedded within each application that uses the binary data.

XML is becoming the standard for exchanging information between applications because XML embeds a description of the data within the data stream, thus allowing applications to share data more easily. XML is easily parsed and can represent complex data structures. As a result, the coupling of applications no longer requires metadata to be embedded within each application.

When you translate binary to XML data, you convert structured binary data to an XML document so that the data can be accessed via standard XML parsing methods. You must create the metadata used to perform the conversion. The translation process converts each field of binary data to XML according to the metadata defined for each field of data. In the metadata you specify the name of the field, the data type, the size, and whether the field is always present or optional. It is this description of the binary data that is used to translate the binary data to XML. Figure 1-1 shows a sample of XML data translation.

Figure 1-1 XML Data Translation of: Tom;Jones;1345;19;

Applications developed on the WebLogic platform often use XML as the standard data format. If you want the data from your legacy system to be accessible to applications on the WebLogic platform, you may use XML Translator to translate it from binary to XML or from XML to binary. If you need the XML in a particular XML dialect for end use, you must transform it using an XML data mapping tool.

 


What is XML Translator?

XML Translator facilitates the integration of data from diverse enterprise applications by supporting data translations between binary formats from legacy systems and XML. XML Translator normalizes legacy data into XML so it may be directly consumed by XML applications, transformed into a specific XML grammar, or used directly to start workflows in BEA WebLogic Process Integrator. XML Translator supports non-XML to XML translation and vice versa and is made up of two primary components:

To perform a translation, you create a description of your binary data using the design-time component (Format Builder). This involves analyzing binary data so that its record layout is accurately reflected in the metadata you create in Format Builder. You then create a description of the input data in Format Builder and save this metadata as a Message Format Language (MFL) document.

You can then use XML Translator's run-time component to translate instances of binary data to XML. Figure 1-2 shows the flow of events for non-XML to XML data translation.

Figure 1-2 Flow of Events for Non-XML to XML Translation Using XML Translator

The Design-Time Component

The design-time component is a Java application called Format Builder. Format Builder is used to create descriptions of binary data records. Format Builder allows you to describe the layout and hierarchy of the binary data so that it can be translated to or from XML. With Format Builder, you can describe sequences of bytes as fields. Each field description includes the type of data (floating point, string, etc.), the size of the data, and the name of the field. Format Builder allows you to further define groupings of fields (groups), repetition of fields and groups, and aggregation.

The description you create in Format Builder is saved in an XML grammar called Message Format Language (MFL). MFL documents are metadata used by the run-time component of XML Translator to translate an instance of a binary data record to an instance of an XML document (or vice-versa). Figure 1-3 shows the process flow of binary and XML data through Format Builder during the design-time phase.

Figure 1-3 Design Time Process Flow through Format Builder

You can also use Format Builder to retrieve, validate, and edit stored MFL documents and to test message format definitions with your own data. The test feature allows you to select the option of testing the translation of XML data to binary format, or binary data to XML format. You may save the transformed data to a file for future testing.

The Run-Time Component

The run-time component of XML Translator is a Java class with various methods used to translate data between binary and XML formats. This Java class can be deployed in an EJB using BEA WebLogic Server, invoked from a workflow in BEA WebLogic Process Integrator, or integrated into any Java application. Figure 1-4 shows the run-time process flow for binary to XML translations and XML to binary translation.

Figure 1-4 Run-Time Process Flow

Binary to XML Translation

Listing 1-1 is a code sample that shows the parsing of a file containing binary data into an XML document object. The MFL file mymfl.mfl is used as the description of the binary data contained in the file mybinaryfile.

Listing 1-1 Sample Code for Binary to XML Translation


import com.bea.wlxt.*;
import org.w3.dom.Document;
import java.io.FileInputStream;
import java.net.URL;

try
{
WLXT wlxt = new WLXT();
URL mflDocumentName = new URL("file:mymfl.mfl");
FileInputStream in = new FileInputStream("mybinaryfile");

Document doc = wlxt.parse(mflDocumentName, in, null);
}
catch (Exception e)
{
e.printStackTrace(System.err);
}


XML to Binary Translation

Listing 1-2 is a code sample that shows the translation of the XML data contained in the file myxml.xml to the a binary format specified by the MFL document mymfl.mfl. The binary data is written to the file mybinaryfile.

Listing 1-2 Sample Code for XML to Binary Translation


import com.bea.wlxt.*;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.net.URL;

try
{
WLXT wlxt = new WLXT();
URL mflDocumentName = new URL("file:mymfl.mfl");
FileInputStream in = new FileInputStream("myxml.xml");
FileOutputStream out = new FileOutputStream("mybinaryfile");
wlxt.serialize(mflDocumentName, in, out, null);
}
catch (Exception e)
{
e.printStackTrace(System.err);
}


 


Post Translation Options and Considerations

After you have successfully translated your binary data to XML, or vice versa, you have numerous options for additional processing of the XML data. The XML data can be transformed to a specific XML dialect or to a display format. The XML data can be sent to other applications that consume XML such as WebLogic Process Integrator. Once your binary data has been put in a self-describing format such as XML, this data is available for use in other applications.

Performing XML Transformation

Once you have translated binary data into XML, you may need to transform the XML data to a different XML grammar, to a display format (HTML), or to another binary format. The process of transforming XML to another XML grammar is referred to in this document as XML transformation. XML transformation can be accomplished via third-party tools such as Apache's Xalan XSLT engine. You might want to transform XML for several reasons:

XSL (extensible stylesheet language) is an XML language that describes a series of transformations that are to be performed on nodes of an XML document. A stylesheet is an XSL document that can be used to map an XML document to another XML dialect or to another text format (such as HTML or PDF). A stylesheet can also be used with the run-time component of XML Translator to transform XML.

Figure 1-5 demonstrates one XML grammar converted to another using an XSLT engine. The transformation metadata in this case is an XSL style sheet that describes how one XML grammar is mapped into another.

Figure 1-5 XML Data Transformation of: Tom;Jones,1345;19

Working with BEA WebLogic Process Integrator

BEA WebLogic Process Integrator is a powerful workflow engine that automates workflow, business-to-business processes, and enterprise application assembly. WebLogic Process Integrator runs on BEA WebLogic Server and is a robust, J2EE standards-based workflow and process integration solution.

Using an intuitive flowchart paradigm, business analysts use the WebLogic Process Integrator Studio to define business processes that span applications or to automate human interaction with applications. Developers can use WebLogic Process Integrator to assemble application components quickly without programming. The assembled applications are executed and managed by the WebLogic Process Integrator engine.

A sample application is included with XML Translator that demonstrates how you can integrate it with WebLogic Process Integrator. The sample application ia a workflow that simulates integration with legacy HR and payroll systems that do not accept XML. In the sample application, an XML document from a JMS topic or a manual form entry is used to initiate the creation of paychecks for employees. The document contains the employee number, hours worked, and pay period ending date. The employee name and pay rate must be extracted from the HR system. The pay is calculated and then sent to the payroll system. Neither the HR nor payroll systems accept XML data. Included with the sample are the following:

For detailed information about using the sample application, see BEA WebLogic XML/Non-XML Translator Samples Guide.

 


Getting Started with the BEA WebLogic XML/Non-XML Translator

The steps outlined in Table 1-1 provide you with a high-level guideline to all of the tasks and processes that you must perform to install, configure, and work with the XML Translator. Think of these steps as a road map to guide you through the process and to point you to the resources available to help you.

Table 1-1 Steps for Working with the XML Translator

Task

Resource

  1. Read the BEA WebLogic XML/Non-XML Translator Release Notes.

BEA WebLogic XML/Non-XML Translator Release Notes.

  1. Make sure that all of the platform/environment prerequisites listed in the Installation and Configuration Guide and in the Release Notes have been met.

BEA WebLogic XML/Non-XML Translator Release Notes and BEA WebLogic XML/Non-XML Translator Installation and Configuration Guide.

  1. Install the BEA WebLogic XML/Non-XML Translator.

BEA WebLogic XML/Non-XML Translator Installation and Configuration Guide.

  1. Define the data format using Format Builder and generate translation metadata.

BEA WebLogic XML/Non-XML Translator User Guide.

  1. Test the translation

BEA WebLogic XML/Non-XML Translator User Guide.