The first step is to obtain an object of class document.This JAR file must then be uploaded to the Integration Repository under Imported Archives.Finally, a word of caution: Since mapping programs are nothing more than ordinary Java classes, the developer has unrestricted access to the entire J2SE class library.However, code that reads or writes files, opens network connections, accesses databases etc.
However, if you are writing a Java program with JAXP 1.4 to perform the validation, it becomes harder. The solution discussed in this blog entry is a Java mapping program, but the techniques described can be applied equally well to an adapter module.Contrary to adapter modules, which are Enterprise Java Beans, Java mapping programs are garden-variety J2SE classes.What are the reasons for wanting to validate messages passing through XI, anyway?For one, mapping programs necessarily make certain assumptions about the structure of the message being processed, meaning that these programs can fail, if the message is invalid.Here is a tutorial example of how to use Xerces XMLReader and SAXParser directly: /** * Xerces Schema - Copyright (c) 2013, Herong Yang.com, All Rights Reserved. SAXParse Exception; import org.apache.xerces.parsers. SAXParser; class Xerces Schema Validator java -classpath .;\local\xerces-2_9_1\xerces Xerces Schema Validator Parsing and validating: Error: Line number: 2 Column number: 4 Message: cvc-elt.1: Cannot find the declaration of element 'p'.Code executing in either has access to the contents of the message being processed and to a validating XML parser.ABAP mapping programs are not an option, as the ABAP XML parser currently does not support XML Schema.should never find its way into your mapping class; your code should only perform transformations on the message being processed.Performing schema validation in Java code is fairly straightforward.