I am using Apache CXF
cxf-codegen-plugin
Maven
plugin to generate sources from WSDL
file. Problem is that I get JAX
I think you want to add in your jaxb-binding.xml:
<jaxb:bindings ... xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
<jaxb:globalBindings generateElementProperty="false">
<xjc:simple />
<!-- ... -->
</jaxb:globalBindings>
</jaxb:bindings>
What I had to do is to wrap jaxb:globalBindings
with another jaxb:bindings
.
<jaxb:bindings version="2.0"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">
<jaxb:bindings>
<jaxb:globalBindings generateElementProperty="false"/>
</jaxb:bindings>
</jaxb:bindings>
Now everything is working, there is no JAXBElement<String>
generated anymore.
You can't have nillable and minoccurs together. Remove the minoccurs as it doesn't make sense for strings anyway.
When we have both minouucrs=0
and nillable=true
in XSD it will generate JAXBElement. To avoid this we need to remove either of the one.
If you use generateElementProperty="false"
property when generating POJO objects from XSD scheme then it will be working like a charm