This week's book giveaway is in the Agile forum.
We're giving away four copies of Head First Agile and have Andrew Stellman & Jennifer Greene on-line!
See this thread for details.
Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JAXB issues  RSS feed

 
Samson Chung
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am running into a small issue here.



Is an xml returned from a web service, as the authoring party have yet to produce an XSD for me, I chose to write one based on what I see.



when I get XJC to generate the jaxb classes, all that came out was ObjectFactory.java

So, how do I unmarshall this xml file to obtain the String?
 
Samson Chung
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Samson Chung wrote:Hi all,

I am running into a small issue here.



Is an xml returned from a web service, as the authoring party have yet to produce an XSD for me, I chose to write one based on what I see.



when I get XJC to generate the jaxb classes, all that came out was ObjectFactory.java

So, how do I unmarshall this xml file to obtain the String?


Solution found,

JAXBElement <String> guidElement = (JAXBElement <String>) unmarshal.....;
guidElement.getValue();

Any issues you guys see with this?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!