This isn't cxf-specific, but I would imagine people here would have run
into this:
When I'm using Java-first mapping, I'm used to adding a pair of
annotations like the following:
@XmlElementWrapper(name = "services")
@XmlElement(name = "service")
In case I have a "List<Service> services" instance variable. This
produces a more reasonable structure in the XML.
However, I'm now trying to go in the other direction. I have a
hand-coded schema with a "services" container and then a list of
"service" elements. The default JAXB mapping produces a "services"
property of type "Services" class that has a "service" property that is
actually of type "list<Service>". Ideally, I'd like this to work
exactly like the reverse direction, where it simply produces a
"List<Service> services" property, ignoring the "Services" class
entirely.
I've read through the various pages that attempt to document the syntax
of the external binding file, but none of the examples cover what I'm
trying to do here.
I thought perhaps that this would do it (some info elided):
-----------------------
<jxb:bindings schemaLocation="<path to xsd>" node="/xsd:schema">
<jxb:bindings node=".//xsd:eleme...@name='services']">
<jxb:javaType name="List<<package>.Service>"/>
</jxb:bindings>
</jxb:bindings>
--------------------------
This just fails with:
[xjc] [ERROR] compiler was unable to honor this javaType customization.
It is attached to a wrong place, or its inconsistent with other
bindings.