Reputation: 305
Below is my xsd for which I am generating Java class .
<xs:element name="DeletionReq">
<xs:complexType>
<xs:sequence>
<xs:element name="Id" type="xs:long"/>
<xs:element name="data" type="tns:data" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="allowedApplDataColumnNamesType">
<xs:restriction base="xs:string">
<xs:enumeration value="code1" />
<xs:enumeration value="code2" />
<xs:enumeration value="code3" />
<xs:enumeration value="code4" />
<xs:enumeration value="code5" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="data">
<xs:sequence>
<xs:element name="dataColumnName" type="xs:string" minOccurs="0" />
<xs:element name="dataOldValue" type="xs:string" minOccurs="0"/>
<xs:element name="dataNewValue" type="xs:string" minOccurs="0"/>
<xs:element name="testRecord" type="xs:string" minOccurs="0"/>
<xs:element name="projId" type="xs:string" minOccurs="0"/>
<xs:element minOccurs="0" name="allowedApplDataColumnNames" type="tns:allowedApplDataColumnNamesType"/>
</xs:sequence>
</xs:complexType>
Generated java class :
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Data", propOrder = {
"dataColumnName",
"dataOldValue",
"dataNewValue",
"testRecord",
"projId",
"allowedApplDataColumnNames"
})
Above namespace is missing which define as complextype in xsd.
Generated complextype "data" don't have namespace which cause issue while unmarshalling the payload.
Any idea how to define xsd correctly so complextype can have namespace.
Upvotes: 0
Views: 28