When WSDL and .xsd are generated, XMLGregorianCalendar is mapped to xs:anySimpleType or xs:date

Viewed 8

I am working on a SOAP web service java project developed in Java 8. EmployeeTpye class is defined as below:

Public class EmployeeType {
    @XmlElement(name = "Name")
    protected String name;
    @XmlElement(name = "Dob")
    @XmlSchemaType(name = "date")
    protected XMLGregorianCalendar dob;    
   ...

Below is generated xsd file:

<xs:element name="Dob" type="xs:anySimpleType"/>
…
<xs:complexType name="EmployeeType">
    <xs:sequence>
      <xs:element name="Name type="xs:string" minOccurs="0"/>
      <xs:element name="Dob" type="xs:date" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

I don’t know why the type of Dob is anySimpleType in <xs:element> and date in <xs:complexType>. How to make the type of Dob also date, instead of anySimpleType in <xs:element>?

0 Answers
Related