after xsd (partial):
<xs:complexType name="Fruit"> <xs:sequence> <xs:element name="type" type="FruitType"/> </xs:sequence> </xs:complexType> <xs:simpleType name="FruitType"> <xs:restriction base="xs:string"> <xs:enumeration value="ABC"> </xs:enumeration> <xs:enumeration value="DEF"> </xs:enumeration> <xs:enumeration value="GHI"> </xs:enumeration> <xs:enumeration value="JKL"> </xs:enumeration> </xs:restriction> </xs:simpleType>
Generating code using xjc will produce the following java code (FruitType is Enum):
@XmlElement(required = true) @XmlSchemaType(name = "string") protected FruitType fruit;
When creating a SOAP WebService with JAX-WS, the following element will be created:
<xs:element name="type" type="xs:string"/>
Which is obviously wrong. I expect it to be
<xs:element name="type" type="FruitType"/>
If I delete this line manually
@XmlSchemaType(name = "string")
everything in wsdl is fine in my java code:
<xs:element name="type" type="tns:FruitType"/>
So the question is: how can I tell JAXB not to generate @XmlSchemaType?
dbaer source share