Details
Description
I'm working on a project which requires creating xml files that conforms to an xsd schema and subsequently send these files using a SOAP service client.
To create java objects from the .xsd i'm using this configuration in pom.xml
<plugins>
...
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>xsdtojava</goal>
</goals>
<configuration>
<additionalJvmArgs>-Djavax.xml.accessExternalDTD=all</additionalJvmArgs>
<sourceRoot>${basedir}/src-gen/main/java</sourceRoot>
<xsdOptions>
<xsdOption>
<xsd>${basedir}/src/main/resources/wsdls/Schema.xsd</xsd>
<extension>true</extension>
<bindingFile>${basedir}/src/main/resources/cxf-bindings.xml</bindingFile>
</xsdOption>
</xsdOptions>
</configuration>
</execution>
</executions>
</plugin>
...
</plugins>
and my cxf-bindings.xml has this content:
<jaxb:bindings jaxb:version="2.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
jaxb:extensionBindingPrefixes="xjc">
<jaxb:globalBindings generateElementProperty="false">
<jaxb:serializable uid="1"/>
<xjc:javaType name="java.time.LocalDateTime" xmlType="xs:dateTime" adapter="it.quantum.fatture.utils.XmlDateTimeConverter"/>
<xjc:javaType name="java.time.LocalDate" xmlType="xs:date" adapter="it.quantum.fatture.utils.XmlDateConverter"/>
<xjc:simple/>
</jaxb:globalBindings>
</jaxb:bindings>
In the generated classes on the root element the extension <xjc:simple> is applied (the 'Type' suffix has been removed and a list member has the plural name 'invoiceBodies') but for nested complex types this seems to not have any effect (all the classes have names like 'InvoiceHeaderType', 'InvoiceBodyType' and so on and list members have the singular name).
Am i doing something wrong and maybe there is some configuration i am missing to recursively apply xjc:simple to all nested complex types?