Generating mappings from an XML schema

To create application data from XML or vice versa that conforms to an existing XML schema, you create the mappings to describe how CICS® will transform the data at run time. You can start from an XML schema or a WSDL document.

Before you begin

You must have a valid XML schema or WSDL document. Before you create the mappings, you must make sure that these preconditions have been completed:
  • You must have a valid XML schema or WSDL document.
  • You must configure the user ID under which DFHSC2LS runs to use UNIX System Services.
  • The user ID must have read permission to access the XML schema or WSDL document and write permission to put the output in the appropriate directories on z/OS® UNIX.
  • The user ID must have a sufficiently large storage allocation to run Java™. You can use any supported version of Java. By default, DFHWS2LS uses the Java version specified in the JAVADIR parameter.

About this task

Use the CICS XML assistant to create the data mappings for the XML schema.

Procedure

  1. Run the DFHSC2LS batch job.
    DFHSC2LS has optional parameters that you can select to meet your requirements, such as selecting a particular code page or specifying how to handle variable-length character data. Use the following parameters as a minimum:
    1. Specify the location of your input file in the WSDL or SCHEMA parameter.
      You can either use a WSDL document or an XML schema. If your input file contains references to other schemas or documents on the Internet and the system uses a proxy server, specify the domain name or IP address and the port number of the proxy server.
    2. Specify the high-level language that you want to generate in the LANG parameter.
      The XML assistant supports COBOL, C, C++, and PL\I languages.
    3. If you are deploying the data mappings in a bundle, specify the name and location of a bundle in the BUNDLE parameter.
    The XML assistant creates a library of supported transformations in the XML binding. For each global element in the input file, the assistant creates a separate transformation.

    If you specify the BUNDLE parameter, the batch job creates a bundle directory structure on z/OS UNIX. The bundle directory has a META-INF subdirectory that contains the bundle manifest. The batch job also creates an XML binding in the bundle directory and places the language structures in the specified location. The XML assistant also places a copy of the input file in the bundle directory. If you do not specify the BUNDLE parameter, the batch job creates the language structures and XML binding only in the specified location.

  2. Install the BUNDLE resource.
    The BUNDLE resource dynamically creates an XMLTRANSFORM resource, which defines the location of the XML schema or WSDL document, the XML binding, and the language structures.

Results

When you generate mappings from an XML schema, CICS generates a language structure for every global element that is present in the schema.

Example

The following example shows DFHSC2LS with the minimum set of parameters specified.
//SC2LS JOB  'accounting information',name,MSGCLASS=A
//  SET QT=''''
//JAVAPROG EXEC DFHSC2LS,
// TMPFILE=&QT.&SYSUID.&QT 
//INPUT.SYSUT1 DD * 
LANG=COBOL
BUNDLE=/u/exampleapp/bundle/test1
LOGFILE=/u/exampleapp/xsdbind/example.log 
MAPPING-LEVEL=3.0
PDSLIB=//CICSHLQ.SDFHSAMP 
PDSMEM=CPYBK2 
XSDBIND=example.xsdbind 
SCHEMA=example.xsd 
/*

What to do next

Write an application program to transform the application data to XML or vice versa. You can use the same mappings for both transformations.