Skip to content
bulldog edited this page Jun 14, 2013 · 1 revision

Q1. Why the generated code contains 'JAXBElement' which will cause compilation issue

A: The root cause of this issue is the wsdl is not following jaxb convension, see details here:
http://docs.oracle.com/cd/E19879-01/820-1072/ahiid/index.html
http://stackoverflow.com/questions/12508741/jaxb-generating-jaxbelementstring-instead-of-string

Please create a custom binding file(for example binding.xjb) with following content:

<jaxb:bindings version="2.0"
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">
    <jaxb:bindings>
        <jaxb:globalBindings generateElementProperty="false"/>
    </jaxb:bindings>
</jaxb:bindings>

Then generate code with custom binding option specified:

bin/mwsc -pico -prefix XYZ_ -d generated -b binding.xjb http://your.wsdl
Clone this wiki locally