Professional Documents
Culture Documents
Document History
Version No. Date Revision Description
Ramana kumar
Contents
1. Introduction ...................................................................................................................................... 2
2. XML Validator.................................................................................................................................... 2
a. Test Case 1: XML Validator ............................................................................................................... 2
b. Test Case 2: XML Validator ............................................................................................................... 5
3. EDI Validator: Scenario ..................................................................................................................... 8
4. Conclusion ....................................................................................................................................... 10
5. References ...................................................................................................................................... 10
2. XML Validator
XML Validator (version 1.x) can validate XML against the XSD schema 1.0. The XML validator validates
the message payload in XML format against the configured XML schema.
Consider a scenario where you want to stop processing the message as soon as the validation error
occurs.
You use this procedure to assign XML schema (XSD files) to validate the message payload in a process
step. The validator checks the message payload against configured XML schema, and report
discrepancies in message payload.
If the validation fails, the Cloud Integration system stops the whole message processing by default.
XML Validator: Browse the XSD and keep the Prevent Exception on Failure checkbox unchecked.
XSD follows:
Once Prevent Exception on Failure option is checked, the processing will continue processing without
throwing an exception. You can handle the validation error scenarios with a route condition as shown
below:
In the Error route content modifier add Validation Error Result: ${header.SAP_XmlValidationResult} in
the Message Body to capture the validation result.
XSD follows:
NOTE: The Validation Result is also available as an attachment in the Message Processing Log.
Note:
• The file name of the xml schema for EDI payloads should have the following format:
o EDIFACT: UN-EDIFACT_ORDERS_D96A.xsd
o ODETTE: ODETTE_ORDERR_2.xsd
o EANCOM: UN-EDIFACT_ORDERS_D96A_EAN008.xsd
HeaderName: If you select Header as EDI Schema Definition, then you can see the field HeaderName,
in Properties view. Enter a valid header for the field.
Note:
This header name is fetched from camel header. The header is added in script element. This script
element is added before converter element. You can add value for this header in the script element.
For example, you can add the value, /xsd/UN-EDIFACT_ORDERS_D96A.xsd for EDIFACT.
4. Conclusion
The document provides an overview of ways to use of Validator in SAP CPI.
5. References
• https://help.sap.com/viewer/368c481cd6954bdfa5d0435479fd4eaf/Cloud/en-
US/20e23e7893fb498480cf52355e09343d.html
• https://blogs.sap.com/2018/09/18/cloud-integration-working-with-xml-validator/