Reputation: 101
I need help to figure out how to generate type as class.
This is the xsd file I have.
<xsd:element name="GetPatient" type="c:GetPatientType" />
<xsd:complexType name="GetPatientType">
<xsd:sequence>
<xsd:element name="fieldA" type="xsd:string" />
<xsd:element name="fieldB" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
However, the result is - I got GetPatientType with the fields, but there is no GetPatient class. My goal is to generate GetPatient with all the three fields as its field. So, GetPatient with field A and field B. Is that possible?
Thanks all for your help!
Upvotes: 1
Views: 736
Reputation: 43671
See this question:
You don't get a class for GetPatient
because JAXB handles it via the JAXBElement<GetPatientType>
construct.
You can, however, customize GetPatient
to generate a class via the <jaxb:class name="GetPatient"/>
customization. But still, that class will not have the fields, it will be just a wrapper class.
See also:
How to generate @XmlRootElement Classes for Base Types in XSD?
Upvotes: 1