> -----Original Message----- > From: eaudet [mailto:[email protected]] > Sent: Thursday, March 10, 2011 1:23 PM > To: [email protected] > Subject: How to get String values out of a JAXBElement object > > Hi, > > I am facing an issue with wsdl2java tool. I read in several other > threads > that you can use a binding to get rid of JAXBElement classes. My wsdl > is > using a complex HL7 schema. wsdl2java generates all the classes without > problems. All classes reflects the schema but at some points, the > element > is a JAXBElement. For some reason, wsdl2java did not generate a class > Value > with children Family and Given classes. Can someone help in getting rid > of > those JAXBElement classes or can tell me how to get the value "toto" > and > "tata" from my objects?
In my experience, the reason xjc "punts" on the code generation is when it finds constructs that can't map directly from schema to Java. For instance, it's legal inside an XML schema element to define two elements with the same name. Once you do that, however, xjc cannot generate strongly-typed properties in the class representing that element. I suppose it's possible you could integrate xjc bindings that would override this, but I'm not sure.
