|
Replies:
2
-
Last Post:
Jul 17, 2008 6:47 AM
by: mshaffer55
|
|
|
|
|
|
|
XJC complex type derived by restriction from another complex type derived b
Posted:
Jul 9, 2008 1:08 PM
|
|
|
Hi ,
I am trying to use wsimport for a wsdl containing these types : <xs:complexType name="Complex_TypeE"> <xs:complexContent> <xs:extension base="Complex_TypeR"> <xs:sequence> ...... </xs:sequence> <xs:attribute name="Version"/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="Complex_TypeR"> <xs:complexContent> <xs:restriction base="Complex_Type"> <xs:sequence> <xs:sequence> ..... </xs:sequence> <xs:sequence minOccurs="0"> ....
</xs:sequence> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType>
The message I am getting is :
[ERROR] Base complex type "Complex_TypeR" is derived by restriction, while this complex type "Complex_TypeE" is derived by extension. This is not currently handled by XJC, but we are seeking input on this issue. Please report this to the JAXB team.
Does anyone know what the issue might be ?
Thanks,
Catalin
|
|
|
|
|
|
|
Re: XJC complex type derived by restriction from another complex type deriv
Posted:
Jul 14, 2008 2:12 PM
in response to: cboloaja
|
|
|
The issue is that, unlike for extension, Java has no obvious analog for restriction. The JAXB 2.1 spec indicates that restriction should be treated exactly the same as extension, i.e. a subclass should be created, but "...there is no requirement that Java properties representing the attributes or elements removed by the restriction to be disabled.". So a restriction of this kind would be pretty much useless, since the resulting subclass would be identical to the base class. Anyway, based on my reading of the spec, which is reasonably clear on this point, I'm surprised by this error. You could try submitting a defect that points to this thread, and see what happens.
|
|
|
|
|
|
|
|
Re: XJC complex type derived by restriction from another complex type deriv
Posted:
Jul 17, 2008 6:47 AM
in response to: mshaffer55
|
|
|
The JAXB RI has a vendor customization you might want to check out:
<xjc:treatRestrictionLikeNewType> - Alternative derivation-by-restriction binding mode
|
|
|
|
|