Unmarshallig XML Objects to Java

37 Views Asked by At

I am developing a Spring-ws SOAP Webservice. Based on a WSDL I have generated the Java Classes.

That is a small piece of my Input XML which makes me some trouble:

    <tar:Verkaufsprodukt>
        <pm:Produkt xsi:type="pm-kf:CT_KfzVersicherung">
        </pm:Produkt>
    </tar:Verkaufsprodukt>

When I try to access the Product object in Java I expect that it has the type CT_KfzVersicherung. But it is of type Produkt.

The Java classes which are generated through jaxws-maven-plugin looks as the following (shortened to the relevant part):

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CT_Produkt", namespace = "http://www.bipro.net/namespace/produktmodell", propOrder = {
    "sparte"
})
@XmlSeeAlso({
    CTProdukt2 .class
})
public class CTProdukt
    extends CTProduktbaustein
{
}

CTProdukt2 is like that:

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CT_Produkt", namespace = "http://www.bipro.net/namespace/versicherung/produktmodell", propOrder = {
    "leistungsausschluss",
    "selbstbeteiligung",
    "klausel",
    "bezugsrecht",
    "wechselVN"
})
@XmlSeeAlso({
    CTKfzVersicherung.class
})
public class CTProdukt2
    extends CTProdukt
{
}

And CTKfzVersicherung is like that:

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CT_KfzVersicherung", namespace = "http://www.bipro.net/namespace/versicherung/produktmodell/kraftfahrt", propOrder = {
    "versichertesFahrzeug",
    "versicherteFahrzeuggruppe",
    "flottenVersicherungsnehmer",
    "vorversicherung",
    "summeLeistungWert"
})
public class CTKfzVersicherung
    extends CTProdukt2
{
}

Do I need to modify anything in my Java Generation process out from the WSDL?

0

There are 0 best solutions below