Validating XML transformations

When you use the CICS XML assistant to map application data to XML, you can specify that the transformations that take place at run time are validated to ensure that they conform to the schema that is contained in the XML binding. You can perform validation on the transformation of XML to binary data or binary data to XML.

Before you begin

During development and testing of your CICS application, full validation assists in detecting problems in the XML. However, full validation of the XML carries a substantial overhead and it is inadvisable to validate XML in a fully tested production application.

CICS uses a Java program to validate the XML against the schema. Therefore, you must have Java support enabled in your CICS region to perform validation.

Procedure

  1. Set up a JVM server in the CICS region.
    The XML validator class can run in an OSGi framework or Axis2, but not in a Liberty profile. CICS provides samples to quickly set up a JVM server that uses an OSGi framework.
    1. Install the sample JVM server DFHJVMS in group DFH$OSGI or create your own JVM server.
      For more information, see Setting up a JVM server.
    2. If you created your own JVM server, modify the DFHPIVAL program definition in group DFHPIVAL to reference the name of the JVMSERVER resource. The DFHPIVAL definition is not locked and can be edited. By default, the definition references DFHJVMS.
  2. Ensure that the XML binding and the schema are in the same location on z/OS UNIX.
    The XMLTRANSFORM resource defines these files to CICS. You can use the INQUIRE XMLTRANSFORM command to check the location of each file.
  3. Turn validation on for the application.
    In CICS Explorer®, open the XMLTRANSFORM resource and edit the Validation Status field in the list of attributes. Alternatively, you can use CEMT or the SPI.

Results

Check the system log to find out if the XML transformation is valid. Message DFHML0508 indicates that the XML was successfully validated and message DFHML0507 indicates that the validation failed.

What to do next

When you no longer require XML validation for the application, update the XMLTRANSFORM resource to turn it off.