uCosminexus Service Platform, Reception and Adapter Definition Guide

[Contents][Glossary][Index][Back][Next]

Appendix E.2 When converting from the binary format to the XML format with the split processing method

This section provides an example of the definitions you need to create when using the split processing method to transform messages from binary to XML format.

Figure E-2 Example of input binary file and output XML file

[Figure]

This example uses header records and trailer records. Split processing applies at the level of individual records.

The following table lists the files required for this transformation:

Table E-2 Files required for transformation (when transforming from binary to XML format)

# File type Format
1 Binary format definition file for input header records FDX
2 Binary format definition file for input data records FDX
3 Binary format definition file for input trailer records FDX
4 Output XML schema XSD
5 Data transformation definition file for header record XSL
6 Data transformation definition file for data records XSL
7 Data transformation definition file for trailer records XSL
8 XML file for output template XML
9 File operation adapter definition file Property file

When inputting a file in binary format, you need to create binary format definition files (#1, #2, and #3) for each record type. Note that because line feed codes are deleted when the file is input, you do not need to specify a terminal separator. You also need to create data transformation definition files (#5, #6, and #7) for each record type.

For details on how to create binary format definition files, see 4.4 Creating Message Formats (Binary Format Definition File)in the manual Service Platform Basic Development Guide. For details on how to create data transformation definition files, see the description for displaying from the Eclipse menu in 6.3.1 Procedure for Defining Data Transformation in the manual Service Platform Basic Development Guide.

  1. Binary format definition file for input header records (FDX file)
    Create the binary format definition file as shown below. Specify FOPHeaderFormat2.fdx as the file name of the binary format definition file.

    [Figure]

  2. Binary format definition file for input data records (FDX file)
    Create the binary format definition file as shown below. Specify FOPDataFormat2.fdx as the file name of the binary format definition file.
    [Figure]
  3. Binary format definition file for input trailer records (FDX file)
    Create the binary format definition file as shown below. Specify FOPTrailerFormat2.fdx as the file name of the binary format definition file.
    [Figure]
  4. Output XML schema
    The file names and contents are the same as for the input XML schema in E.1 When converting from the XML format to the binary format with the split processing method.
  5. Data transformation definition file for header records (XSL file)
    Create the data transformation definition file as shown below. Specify FOPHeader2.xsl as the file name of the XSL file. Specify FOPHeaderFormat2.fdx as the transformation-source schema and FOPSchema.xsd as the transformation-target schema.

    [Figure]

    In this example, the only nodes to be mapped are the header elements. For details on how to limit which nodes are subject to mapping, see 6.4.8 Restricting mapping range in the manual Service Platform Basic Development Guide.
  6. Data transformation definition file for data records (XSL file)
    Create the data transformation definition file as shown below. Specify FOPData2.xsl as the file name of the XSL file. Specify FOPDataFormat2.fdx as the transformation-source schema, and FOPSchema.xsd as the transformation-target schema.

    [Figure]

    In this example, the only nodes to be mapped are the data elements.
  7. Data transformation definition file for trailer records (XSL file)
    Create the data transformation definition file as shown below. Specify FOPTrailer2.xsl as the file name of the XSL file. Specify FOPTrailerFormat2.fdx as the transformation-source schema, and FOPSchema.xsd as the transformation-target schema.

    [Figure]

    In this example, a set constant function is used to restrict mapping to the info1 element only.
  8. XML file for output template
    Use an application such as the WST (Web Standard Tools) provided by Eclipse to create an output template XML file. Specify xml_output_template.xml as the file name.
    The records in the output template XML file below are replaced with transformed records when the file is output. Create the output template XML file according to the output XML schema of the records. Transformed records cannot be output unless the file conforms to the output XML schema.

    [Figure]

  9. File operation adapter definition file
    In the Service adapter definition (details) screen, select cscFileOperation.properties in the Self-defined file area, and click Edit. Then, define the file as follows:

    [Figure]

  10. Service adapter definition
    In the Service adapter definition (details) screen, add the following files as self-defined files:
    • FOPHeaderFormat2.fdx
    • FOPDataFormat2.fdx
    • FOPTrailerFormat2.fdx
    • FOPHeader2.xsl
    • FOPData2.xsl
    • FOPTrailer2.xsl
    • xml_output_template.xml