on 02-04-2010 6:17 PM
Hi experts,
I have created an interface to send differents messages between bussines system, the bussiness system receiver is put in the message, to get this value I have a configuration file indicating the path of this field for each message type. In a java mapping I transform the message sent in this structure:
<document>
<message>HERE THE MESSAGE AS STRING</message>
<parameters>
<sender>HERE SENDER BUSSINESS SYSTEM</sender>
<receiver>HERE RECEIVER BUSSINESS SYSTEM</receiver>
</parameters>
</document>
the messaging interface works fine, but now I have to validate the XML vs XSD. I need doing in a java mapping because the messaging interface send the message and a email to sender in error case.
To do this validation I have implemented two java mappings that works fine in my local, the first way is with class Validator of java 5, but my system PI 7.1 return an error with this class. The second way is with SAX parse:
String schema = "XXXXXxsd";
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
docBuilderFactory.setNamespaceAware(true);
docBuilderFactory.setValidating(true);
docBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage","http://www.w3.org/2001/XMLSchema");
InputStream is = this.getClass().getClassLoader().getResourceAsStream(schema);
docBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource",is);
in my local works fine but in PI always return OK never fail.
For this moment the schema is hardcoded to do proofs, in the future will be loaded from my configuration file.
Any idea?
Thanks in advance
Jose
hi Jose,
PI 7.1 has a built in feature available called XML vaidations ..
your source xml can be validated against a XSD placed at a specific location on the PI server..
validation can be performed at adapter/integration engine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried Adapter enhancement?
You can write a module and deploy in PI where you perform all XML validations and if found invalid create a target structure capturing those errors
Regards
Sourabh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.