Skip to content
Advertisement

JAXB generating JAXBElement instead of String

I am using Apache CXF cxf-codegen-plugin Maven plugin to generate sources from WSDL file. Problem is that I get JAXBElement<String> generated instead of String. I have added the jaxb-bindings.xml file which looks like this:

JavaScript

This should prevent JAXB to generate JAXBElement<String>. But it is not working I still have JAXBElement<String> generated instead of String.

My Maven plugin looks like this:

JavaScript

CXF version is 2.6.0. Does someone know where might be the problem?

EDIT

The XSD is very huge. This is the element which generating JAXBElement<String>

JavaScript

And the generated source is:

JavaScript

Advertisement

Answer

What I had to do is to wrap jaxb:globalBindings with another jaxb:bindings.

JavaScript

Now everything is working, there is no JAXBElement<String> generated anymore.

Advertisement