Hitachi

uCosminexus Service Platform Reference Guide


cscjsonxmlconv (Mutually transforming JSON format data and XML format data)

Organization of this page

Format

cscjsonxmlconv -in path-of-input-file
               -out path-of-output-file
              [-f path-of-JSON-XML-transformation-definition-file]

Function

Generates a file from the result of mutually transforming JSON format data and XML format data.

This command is saved in the following location:

service-platform-installation-directory\CSCTE\bin

When executing the command, move to this location or specify the path.

Arguments

-in path-of-input-file

Specifies the path of the input file as an absolute or relative path. You can specify files whose extension is .json or .xml.

-out path-of-output-file

Specifies the path of the output file as an absolute or relative path. The files that can be specified depend on the file specified in the -in option.

  • If the extension of the file specified in the -in option is .json:

    Files with .xml extension can only be specified.

  • If the extension of the file specified in the -in option is .xml:

    Files with .json extension can only be specified.

If the specified directory does not exist, a directory is generated and files are output. If a file having the specified name already exists, the existing file is overwritten.

-f path-of-JSON-XML-transformation-definition-file ~ <<service-platform-installation-directory\CSCTE\config\tools\json\csc_json_converter.properties>>

Specifies, as an absolute or relative path, the path of the JSON-XML transformation definition file in which the transformation operation between JSON format data and XML format data is specified.

To apply the JSON-XML transformation definition file, the following two methods are available:

  • Use the -f argument to specify a JSON-XML transformation definition file

    You can specify the file name of the desired JSON-XML transformation definition file.

  • Omit the -f argument so that the specified file is automatically read

    If you omit the -f argument, the following file is read. You must store the JSON-XML transformation definition file with the following file name in advance. You can also edit the file contents.

    service-platform-installation-directory\CSCTE\config\tools\json\csc_json_converter.properties

    If this file does not exist, operation is performed with the default values of the JSON-XML transformation library. For details about the JSON-XML transformation library, see the manual Service Platform Basic Development Guide.

JSON-XML transformation definition file

In this file, the transformation operation between JSON format data and XML format data is specified in the Java property file format. The available character code is UTF-8 only. You can specify this file in both the cscjson2xsd command and cscjsonxmlconv command.

The following shows the template file. To specify the -f argument after editing the template file, save the file with a desired file name.

service-platform-installation-directory\CSC\config\msg\templates\csc_json_converter.properties

For details about how to define the JSON-XML transformation definition file, see 3.13.1 JSON-XML transformation definition file.

Return value

Return value

Meaning

0

Normally terminated.

1

Abnormally terminated.

9

An error occurred when checking the execution permission.

Notes