Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache AXIS Ignore/Skip additional element while parsing

We consume the web service of third party. Whenever they update the XML schema like add the new element we got the following error message.

"SAXException: Invalid Element ... "

Is there any way in AXIS to ask skip the additional element received on XML while parsing it?

I have generated web service client using AXIS earlier i used to receive XML as below

<Flight>
   <AirlineCode>AB</AirlineCode> 
</Flight>

and everything was working fine. But now i am getting an additional tag in response.

<Flight>
   <AirlineCode>AB</AirlineCode> 
   <OtherCode>XX</OtherCode> 
</Flight>

And for that i am getting "Invalid Element" Exception.

Thanks

like image 385
Ankur Raiyani Avatar asked Sep 26 '12 08:09

Ankur Raiyani


1 Answers

Apache Axis2 version 1.7.0-SNAPSHOT has the ability to ignore unexpected elements by compiling with the -Eiu switch.

Downloads for 1.7.0-SNAPSHOT

like image 64
Daniel Avatar answered Oct 17 '22 22:10

Daniel