Skip to Content

Introduction

XML Validation is one of the new capabilities in SAP NetWeaver Process Integration 7.1. Many XML based industry standards like Rosettanet, CIDX, PIDX, etc. have specified the requirement to validate XML messages at various stages of message processing. This feature is highly demanded by customers and hence has been delivered as a major capability with SAP NetWeaver Process Integration 7.1.

XML validation allows you to check the structure of a PI message payload. You can validate the payload of both inbound and outbound messages. The structure check is performed using saved data types (XSD or DTD’s). This feature can be used for both A2A and B2B integration.

Overview

Architectureimage

All inbound and outbound messages are validated against the data types (XSD or DTD’s) in the Enterprise Services Repository. To validate the structure of a PI message payload, you should export the schemas from the ESR and save them in the file system of PI.

When processing a PI message, the structure check can be performed at the sender adapter or at the Integration Engine. You activate the validation in the collaboration agreement. Incoming messages can be validated either at the sender adapter or the Integration Engine. However, outgoing messages can only be validated at the Integration Engine.

Validation in the Sender Adapter

When an inbound message enters the sender adapter, the adapter converts this message into a PI message. The payload of this message can be validated against the configured schema, which is stored in the file system. If the structure of the payload differs from the definition of the data type provided for comparison, message processing is stopped.

When validation fails, the adapter sends a (synchronous or asynchronous) response to the sender of the message, informing it about the structure error. This is referred to as Backward-error handling. The industry-specific adapters inform the sender asynchronously, as required by the RNIF protocol and the CIDX protocol. Only the sender adapter supports backward error handling.

All sender adapters (including non-SAP adapters) can perform XML validation.

Validation in the Integration Engine

In inbound and outbound processing, validation of the PI message payload takes place as a pipeline step of the Integration Engine. If the structure of the message payload does not match the saved definition of the data type, an error description is generated. The error description contains status information and a list of all structure errors. In this case, message processing is stopped. The message is set to error status and an error report is saved.

The Integration Engine supports Forward-Error handling. In forward error handling, the sender of the message is not automatically informed of the structure error. The message is set to error status and an administrator can process the message further using the Runtime Workbench. The administrator can resend the message by correcting the payload or skip the validation step.

Configuration

Configuration 

You define whether and where the validation of the PI message payload takes place in the respective collaboration agreement. In a sender agreement, you can choose between validation in the sender adapter or the Integration Engine. If validation takes place in the adapter, a response is sent to the sender when an error occurs.

In the receiver agreement, you can configure the validation in the Integration Engine. If validation takes place in the Integration Engine, the message is set to error status and can be processed by the administrator in the Runtime Workbench in the case of an error.

Administration

Monitoring and administration takes place in message monitoring of the Runtime Workbench or the NetWeaver Administrator and in the Integration Engine.

The messages that have an error status following validation can be processed further by an administrator in the Runtime Workbench. The administrator can resend messages and skip the validation step.

To report this post you need to login first.

8 Comments

You must be Logged on to comment or reply to a post.

  1. Bhavesh Kantilal
    Hello Shilpa,
    You have mentioned that the schema for the validation has to be loaded on the filesystem of PI.

    Is there some specific tool that has been provided to do the same? Normally getting filesystem access to the PI server is restricted to the Admin’s and hence doing this manually can be a pain point.

    Also, is there a specific path and naming conventions for these files? In the screen shots above there seems to be no option to select the schema’s . How does XI select the schema’s in the runtime for validation?

    Thanks for the blog. Definitely a feature that will be used widely.

    Regards
    Bhavesh

    (0) 
  2. Sebastian Simon
    Hello,

    Definitly this is will be a useful feature, required in many scenarios.
    Anyway it would have been a lot more comfortable if there would be no export to the file system required, as Bhavesh mentioned its often hard for XI Developers to gain access to the file system of the XI system and also to simplify matters, everybody would expect a tool like SAP PI to be able to find the schema more intuitional and comfortable without an “extra” step as the Message Definiton already sits in the repostitory.

    Useful feature anyway, 2 steps forward and 1 step back for the manual file export 🙂

    With best regards
               Sebastian

    (0) 
  3. Kalle Pokkinen
    Hi,
    a very obvious question around this feature:
    How does this impact performace? Does message size/complexity/load cause different performance results?

    Also, is the validation for the message in different steps of the process done through the same underlying code? In other words, is a validation done as part of the integration process the same validation which is done as part of an adapter?

    Would be awesome to get some more details regarding the performance impact of this very useful feature.

    Cheers

    Kalle

    (0) 
  4. Ranjit Deshmukh
    Hi,
    Thank you for such a nice blog!
    Basically I have not used PI7.1 yet..
    But can you throw some light on the way the errors will be collected for a faulty payload?

    As we all know, for a faulty payload lets say which throws string exception which actually is a runtime exception- the trace header in SXMB_MONI will show only the first occurence of the error and not the collected one i.e. if a field(0..unb) in payload is having few values which are faulty but rest are fine- can we point out just those which are having errors?

    So also is it possible to identify some key fields from a faulty payload? for sorting out the error records and correcting them?

    If above 2 points were possible then it would be of great help; if not then the customer surely would disagree on failing the whole payload even though there is just one error record in it.

    Also as it is discussed earlier access to file system is a hefty descision to make, even though I have made its use as per:
    Validations using Java for those not having PI7.1

    Ranjit.

    (0) 
  5. Ranjit Deshmukh
    Hi,
    Thank you for such a nice blog!
    Basically I have not used PI7.1 yet..
    But can you throw some light on the way the errors will be collected for a faulty payload?

    As we all know, for a faulty payload lets say which throws string exception which actually is a runtime exception- the trace header in SXMB_MONI will show only the first occurence of the error and not the collected one i.e. if a field(0..unb) in payload is having few values which are faulty but rest are fine- can we point out just those which are having errors?

    So also is it possible to identify some key fields from a faulty payload? for sorting out the error records and correcting them?

    If above 2 points were possible then it would be of great help; if not then the customer surely would disagree on failing the whole payload even though there is just one error record in it.

    Also as it is discussed earlier access to file system is a hefty descision to make, even though I have made its use as per:
    Validations using Java for those not having PI7.1

    Ranjit.

    (0) 

Leave a Reply