cancel
Showing results for 
Search instead for 
Did you mean: 

Java Mapping (Validation)

Former Member
0 Kudos

Hi Guys

I followed this blog for validation of XML.

I have coded the JAVA Program in NWDS as per the blog, all fine but am not sure about the schema step.

What i did was:

1) Exported the .xsd of the Message type.

2) Then Schema.xml file creation i am not sure of it

Do any one know how to do that , and what is the purpouse of the Schema method in the Java Mapping.

Is this blog does a input initerface format check and write in to a log.

But cannot we do this with the help of Alert by triggering mails ??

Can we achieve element level vaslidation (to all element of the XML) using this method.

Kindly share u r views

Srini

Accepted Solutions (0)

Answers (3)

Answers (3)

santhosh_kumarv
Active Contributor
0 Kudos

Hi Venakt,

PI 7.1 Release have a functionality of XML validation, which check the inbound XML file against a schema (or structure) that the inbound XML is suppose to have. The author of this blog explains how the same functionality can be achieved in PI7.0 or XI using a Java Mapping.

To validate the schema he has uploaded the generic schema definition in the IA and uses it in his java mapping to validate the inbound file.

I believe that the scenario you are implementing is to validate the value that the each field is holding and not the structure of the inbound XML file. If it is so check the document that I replied earlier.

Thanks

SaNv...

Former Member
0 Kudos

Hi Santosh,

Thx for u r reply.

I understood what u r saying .

One more question :

See u r Doc is validating particular element , date and time using api.All good, what if i need to validate entire XML Elements , should i repeat the same for entire element.

i was so curious with his blog because , it was generic and moreover i thought i can validate entire XML , by not sticking to particular element.

What is IA ?? U Memtioned ??

Could above requirment can be achieverd r else i should get each element and validate , no other go

based upon on the outbound interface

regards

srini

santhosh_kumarv
Active Contributor
0 Kudos

>>See u r Doc is validating particular element , date and time using api.All good, what if i need to validate entire XML Elements , should i repeat the same for entire element.

Yes you got it right... u have to read all the elements of the XML and validate as per your requirement...

>>What is IA ?? U Memtioned ??

I was suppose refering to the Imported Archive

>>Could above requirment can be achieverd r else i should get each element and validate , no other go

Yes.. you have to write code to navigate to each of the element

Thanks

SaNv...

Former Member
0 Kudos

Hi,

thx for the reply , all clear

regards

srini

Former Member
0 Kudos

Hi,

Here the schema method checking the schema name is correct or not. The schema name is an attribute that's why he is moving upto attribute level in xsd.

You can validate things using java code. First you have to go to the level of the element and get that element and validate the element.

First you have to reach the element what value you have to validate.

Thanks,

RamuV

Former Member
0 Kudos

Thxs for reply guys,

All my question was about the Schema (.XSD file) ,How this step helps me out.

For Instance i have : MT_OUT (Outbound Interface)

I import this to my local file SYstem.

Well in the blog Author has said that i can use it as import Archive

or maintain it in a seperate XML to calidate all the XML

How the method Schema in the mentioned java mapping going to help me.

thx in advacne for help

regards

Srini

santhosh_kumarv
Active Contributor
0 Kudos

Hi Venkat,

Check this white paper that I have published.

[Value Validation of XML File Using Java Mapping|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a08e8c15-682d-2b10-7798-c4592a417074]

Would definately give you an idea on validation using java mapping.

Thanks

SaNv...