That works, but doesn't solve my problem. My input is: <contact>Jim</contact> // actually, it would have some attributes, but I'm just trying the simplest case right now
The annotations you mentioned produce XML like so. <contact><name>Jim</name></contact> The problem is there appears to be a bug in CXF when I publish the endpoint where a mapped object has the @XmlValue annotation. Everything I can find says that's the correct way to indicate the XML should be read/written in the format I'm looking for, but CXF gives the error when I actually try to use Endpoint.publish() to start the server listening for requests. I've tried with and without XmlRootElement definitions, XmlType with propOrder, all sorts of things that various examples seem to indicate might help, but nothing works. Maybe I'm missing something, but it sure looks like a bug. If a class has @XmlElement property, it cannot have @XmlValue property. this problem is related to the following location: at private java.lang.String com.transunion.cis.iq411.soap.C360Contact._name at com.transunion.cis.iq411.soap.C360Contact at public com.transunion.cis.iq411.soap.C360Contact Chris -----Original Message----- From: Tomas Majak [mailto:tomas.ma...@nasdaqomx.com] Sent: Friday, November 13, 2009 12:11 AM To: users@cxf.apache.org Cc: Kessel, Christopher Subject: RE: @XmlValue complaining about non existent @XmlElement What about using: @XmlElement(name = "name") private String _name; And class annotation: @XmlRootElement(name = "contact") @XmlAccessorType(value = XmlAccessType.NONE) public class C360Contact { -----Original Message----- From: Kessel, Christopher [mailto:ckes...@transunion.com] Sent: den 12 november 2009 19:29 To: users@cxf.apache.org Subject: @XmlValue complaining about non existent @XmlElement I've got a really simple data class. public class C360Contact { @XmlValue private String _name; public String getName() { return _name; } public void setName( String name ) { _name = name; } } I'm trying to indicate the value for the "name" attribute is in the content of the tag rather than a tag on its own. E.g. <contact>Jim</contact> vs. <contact> <name>Jim</name> </contact> However, I get the following error when publishing the endpoint. Any idea why? Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions If a class has @XmlElement property, it cannot have @XmlValue property. this problem is related to the following location: at private java.lang.String com.transunion.cis.iq411.soap.C360Contact._name at com.transunion.cis.iq411.soap.C360Contact at public com.transunion.cis.iq411.soap.C360Contact com.transunion.cis.iq411.soap.C360Request.getContact() at com.transunion.cis.iq411.soap.C360Request this problem is related to the following location: at public java.lang.String com.transunion.cis.iq411.soap.C360Contact.getName() at com.transunion.cis.iq411.soap.C360Contact at public com.transunion.cis.iq411.soap.C360Contact com.transunion.cis.iq411.soap.C360Request.getContact() at com.transunion.cis.iq411.soap.C360Request