Skip to Content
avatar image
Former Member

XML Validation against XSD and ACK Message

Hi,

I have a HTTP -> SAP PI -> IDOC scenario.

HTTP application will send a XML message, now in SAP PI I have to check if this XML message is proper or not (as per the XSD of the message).

If the message is not as per the XSD then SAP PI should respond with a custom XML message to the sending party indicating that the message is not a proper XML (please do not suggest me to configure Alert; I want to provide an ACK and not an alert).

What I think is:

1) I cannot use the XML Validation feature of SAP PI, as it will throw an error and not help me in sending an error-XML message (Acknowledgement) back to the sending party.

2) Using Conditional Receiver Determination, I can check if a node (not) exists/ if a node has required value or not and then call another Service which can send the ACK message back to the Sending Party.

This approach is not feasible in a scenario where I have many fields inside the XML message.

How to proceed on this?

Thank you,

Pankaj.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 29, 2010 at 08:28 AM

    Hi,

    you might use the following option.

    Instead of using the HTTP Adapter, you should use the SOAP Adapter.

    You can still use regular HTTP instead of SOAP (just need to specify "No SOAP" in the Communication Channel)

    You choose SOAP because then you have the option to check "Validation in the Adapter" in the Sender Agreement.

    When the application sends a message by HTTP, the SOAP Adapter will validate the message.

    If it is not correct, the sender will get a error reply message saying what is not correct in his message (you can not customize it but the error message already contains details on the type of error)

    Best regards,

    Markus

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 24, 2010 at 12:59 PM

    you can write a java mapping that will do the validation for you - /people/ranjit.deshmukh/blog/2008/01/14/validations-using-java-for-those-not-having-pi71

    then based on a flag that can be incorporated, you can send the required response.

    Add comment
    10|10000 characters needed characters exceeded