X hits on this document





90 / 120

COBOL program. In the example exercise, the XML marshalling layer for each program

is implemented in the target language itself. So that the Java program can generate and

consume XML based on the XML Schema that describes the interface to the COBOL

program, we employ the Java Architecture for XML Binding (JAXB) [35]. JAXB

facilitates the conversion of Java objects to XML and vice versa. Sun's Java JDK

includes a command-line utility xjc which generates Java marshalling code from an XML

Schema—making it quite easy to write a Java program which consumes and generates

XML based on an XML Schema. While generation of XML is nicely handled in COBOL

by the XML GENERATE statement, consuming XML involves coding an event handler

for the XML PARSE statement. Of course, complete code for both the Java and COBOL

XML marshalling layers is included in the solution to the exercise, so if COBOL is a

foreign language to you, there's no need for concern. Once the XML marshalling layers

are in place, there's one more loose end that needs to be tied up; and that is to figure out

how to pass XML documents between the two layers. Since we are in a local scenario,

TCP/IP is not an option, therefore a thin Java Native Interface (JNI) layer is needed

through which the Java and COBOL marshalling layers can exchange XML; note that the

COBOL XML marshalling layer invokes the legacy COBOL application. Fig. 9.4

illustrates the program architecture for the exercise.


Document info
Document views204
Page views205
Page last viewedMon Oct 24 16:25:45 UTC 2016