This week's book giveaway is in the OCAJP forum. We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line! See this thread for details.
In my project the response is coming in the form of xml string and i need to parse and populate my value object i.e java bean with getter and setter methods
for e.g <application> <applicant>bhavesh</applicant> </application> application and applicant are java bean
can you please help on this , kindly advice.
Vijay K Vivek
posted 8 years ago
You can use JAXB.
1) Get the xml schema definition for your xml. 2) Use JAXB to get the corresponding element classes for your XSD (xml schema definition ) 3) In the code that you have use the unmarshaller and obtain the objects for the XMl elements. 4) Write mappers which will map between your value objects (beans) and the objects of the JAXB generated classes.