following xsd (partial):
Generating code with xjc will generate the following java code (FruitType is an Enum):
@XmlElement(required = true)
@XmlSchemaType(name = "string")
protected FruitType fruit;
When generating a SOAP WebService with JAX-WS the following element will be generated:
Which ist obviously wrong. I'd expect this to be
If I delete this line by hand
@XmlSchemaType(name = "string")
in my Java Code everything in the wsdl is fine :
So the question is: How can I tell JAXB not to generate the @XmlSchemaType?
解决方案
Instead of referencing FruitType with type
the trick ist to have a simpleType inline:
this will generate the correct java file and WSDL: