Hi,
Turns out I am having inheritance issues with JAXB. While unmarshalling,
jaxb complains saying it can't instantiate my abstract class. I've
noticed there are several inheritance issues with both Jaxb & Aegis, but
I can't figure out what the exact limitations are.
I also saw a workaround using the jaxb.search.packages property, but
since I am using Spring I can't find a way to add this to my
servicebean. In addition to that, I doubt this would help me because all
my classes are in the same package.
Extract of my wsdl/xsd:
<xs:complexType abstract="true" name="AbstractValue"/>
<xs:complexType name="DateRange">
<xs:complexContent>
<xs:extension base="tns:AbstractValue">
<xs:sequence>
<xs:element
name="RangeStart" type="xs:dateTime"/>
<xs:element
name="RangeEnd" type="xs:dateTime"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="String">
<xs:complexContent>
<xs:extension base="tns:AbstractValue">
<xs:sequence>
<xs:element name="Value"
type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
My Java code looks like this:
Abstractvalue.java
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AbstractValue")
public abstract class AbstractValue {}
DateRangeValue.java
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DateRange", propOrder = {
"rangeStart",
"rangeEnd"
})
public class DateRangeValue extends AbstractValue {
@XmlElement(name="RangeStart", required = true)
protected Date rangeStart;
@XmlElement(name="RangeEnd", required = true)
protected Date rangeEnd;
// getters & setters
}
StringValue.java
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "String", propOrder = {
"string"
})
public class StringValue extends AbstractValue {
@XmlElement(name="Value", required = true)
protected String string;
// getters & setters
}
Please note I am using code-first development. Another issue I'm facing
is, that StringValue & DateRangeValue don't appear in my wsdl. My
workaround for this is by adding operations that use these actual types
as a parameter. Any better way to do this and fix the inheritance?
Dylan Honorez
R & D Consultant
4C Technologies / kZen
+32 (0)485 / 69.28.12
[EMAIL PROTECTED]