Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JAXB subclass and attribute problem

843834Oct 30 2007 — edited May 23 2008
My schema has a complex type and an sub-complextype. Both of these types have elements of type string.

The classes that are generated look fine, they both have the attributes created as JAXBElement<String>.

Over the wire, the xml nodes for the attributes are not set correctly

For instance...here is one of the attributes
@XmlElementRef(name = "Name", namespace = "http://schemas.xxxxxx", type = JAXBElement.class)
protected JAXBElement<String> name;

On the wire it should look like
<nsXX:Name>YYY</Name>

instead it looks like
<nsXX:string>YYY</string>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 20 2008
Added on Oct 30 2007
2 comments
201 views