Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAXB issues

 
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