• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using JAXB to convert Java Object to XML

 
Yogesh Gandhi
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,

I have a requirement, where I need to convert XML to Java Object.
In other words, I have the data ready with me, I have to create the XML of that data.

I was able to create XML successfully using JAXB provided with Java 1.6. But the problem is that my client has Java 1.4 moreover the editor I am using also doesn't supports Java > 1.4

Here is the XSD I have to use........I'll describe the problem in detail beloww.



I am using Java Web Services Developer Pack (jwsdp-1_4-windows-i586.exe) to convert my data to XML.

But the problem I am facing is, I am not able to understand how do I set the list in it.

The Code which is working in java 1.6 is



The problem is I do not find proper equivalent classes when generated by JWSDP...


How do I get a TxnlistType Handle? It gives me a null.
Moreover there is no setDebit and setCredit Method in the TxndataTypeImpl class.



I am very much confused.

Please suggest me alternative tools which I can use freely to convert my Java object to XML and vice-versa.

Please do remember that it must work on Java version 1.4

Many Thanks in Advance...

 
Junior Fortunato
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Yogesh,
I´m not completely sure, but I guess XStream is what you are looking for.
Have you tried?
I hope it can help you.
 
Yogesh Gandhi
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks my dear friend Junior Fortunato


I would definitely give it a try, if it does not have any licensing issues and is usable in my company.

Will check it tomorror for sure.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic