Validating xml documents against xml schema

The XML Schema technology has been a core component of SAP Exchange Infrastructure since version 3.0, but as of SP16 it’s still not possible to have the Integration Server validate messages against an XML Schema.

In other words, even if an interface is based on a message type, which is ultimately defined by a schema, we cannot know whether or not messages on the interface are valid according to that schema.

For more complex document types or if your schema is modified often, inline schema solutions are not as effective.

In the following example, we will create two versions of an XML resource file (and not Valid.xml) that include XSD schemas.

Failing an invalid message early helps pinpoint the exact cause of the problem and provides the developer with better debugging information.

Another prime reason for performing validation, is ensuring the data quality of messages that go out to external partners, suppliers and customers. outside the Integration Engine core), XML Schema validation can be implemented in a Java mapping program or in an adapter module.

Code executing in either has access to the contents of the message being processed and to a validating XML parser.

For simple document types where the schema is stable and unlikely to change, this approach works well.] is a World Wide Web Consortium standard for describing the structure and content of XML documents.A document is said to be valid according to an XML Schema, if the document adheres to the rules specified in that 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.

Leave a Reply