In PI 7.1 validation functionality is available, so now with the help of PI 7.1 we can validate our incoming and outgoing messages in IE as well as in AAE corresponding to their structure i.e. XSD or DTD. This article describes XML Validation in the IE. In my next article, I will demonstrate how we can validate XML messages and message header in AAE.
There are couple of presentations on SDN, that’s tell about validation functionality in PI 7.1, but this article is posted in order to demonstrate the steps which are required to achieve it practically.
When we talk about XML validation in IE, then our incoming messages are validated corresponding to their schemas that are stored in File system. In PI 7.1 new Pipeline steps are introduced (“XML Validation Inbound Channel Request” and “XML Validation Outbound Channel Request”) to achieve validation.
If validation fails (Inbound side or Outbound side), then message processing will be stopped. Example, if we validate our incoming messages in IE and if invalid XML entered in IE then processing will fails in second step i.e XML Validation Inbound Channel Request”. In previous versions these messages fails in “Request Messaging Mapping” step.
So if validation fails in IE, Error description will be visible in MONI. It gives detailed error description and all structure errors information’s.
Important: If validation performed in IE, then sender will not get information about the failed structures. Administrator will look on these messages and can take further actions. In case of validation in AAE, adapter can send the error message to the sender.
“Fault Messages, Receipt Acknowledgement, Exceptions are not validated”.
Following steps demonstrate how we achieve the incoming XML validation in IE.
1. Design your objects in the ESR.
2. Configure your objects in the ID.
3. Required to validate incoming messages by IE, so check the option “Validation by Integration Engine” in Sender Agreement.
4. Create appropriate directory structure where we have to save our structure (xsd).
usrsap<system id>SYSglobalxiruntime_server<A><B><C><D><E><F>
A – validation
B – schema
C – GUID of the SWCV where service interface reside.
D – Repository Namespace where Service Interface is created.
E – Service Interface Name
F – Repository Namespace where Message Type or External Definition is assigned.
Note: if your ESR namespace contains special character then do replace it with “~” in folder name.
If namespace is http://farooq.com/XI/FileToFile
then folder name should be
http~farooq.com~XI~FileToFile
Export schema from the ESR and save it in folder “F” with name <<RootElementOfMessageType>>.xsd
. So in this case it is MT_File_Sender.xsd
5. Testing of the Scenario.
In this example, all designed values for source MT are mandatory. What happen if ZIP tag is missing in sender message or payload.
In XML document ZIP is missing
Message fail in IE and message processing stopped. The Error description is appropriate for the administrators.
Similarly we can validate outgoing messages in IE by selecting an option “Validation by Integration Engine” in Receiver Agreement.
Farooq Farooqui is an SAP NetWeaver PI Consultant with Cognizant, India. He holds SAP PI Certification and has previously worked with majors like Accenture and Atos Origin.
Excellent article.. Keep posting,,,
Hi there
I have recently installed and configured PI 7.1
I have creaated a software component in SLD.When i go to,Enterprise service Builder,i dont see any option to import a software component from SLD,which i used to do in both XI 3.0 and PI 7.0
I would really appreciate if you could help me ASAP.
Thanks in advance.
Hi,
in Enterprise service Builder click on Create object button -> in that you can find WorkAreas expand that WorkArea… there you can find option software commponent verion………there you can find the option import from SLD.
If you still cant find then reply back.
Regards,
Phani
Hi phani
thank u so much for your prompt reply.
I m having several issues with PI 7.1
I would appreciate if you could give me your email id,so that i can send you all my problems.
thanku so much for your kind help
Hi Everyone,
I have a scenario(File to Idoc) where I use message split without BPM., (1:N transformation), for this to work I have to remove XML Namespace from my Message Type so that message split works perfrectly. I have another requirement in the same scenario where I have to validate input file(XML validation), as I removed namespace in Message Type XML validation does not work.
Please suggest me how can I ensure both Message split and XML validation works in this scenario.
Thanks in advance.
Priya.
Hi,
my id phani2084@gmail.com
Hi,
You mentioned that:
If validation performed in IE, then sender will not get information about the failed structures. Administrator will look on these messages and can take further actions. In case of validation in AAE, adapter can send the error message to the sender.
I have a requirement to send the validation message back to the sender, I have a HTTP –> PI –> IDOC scenario and PI version is 7.1.1
Can you please help me. I have even posted the query on SDN:
http://forums.sdn.sap.com/thread.jspa?threadID=1792417&tstart=0
Thank you,
Pankaj.
Hi,
Could you pls briefly explain the pros and cons of using xml validation in sender agreement.
Regards,
Priya