users@jax-ws.java.net

Re: JAXB xsi:type problem

From: Jon Miller <jemiller_at_uchicago.edu>
Date: Thu, 20 Jul 2006 09:38:28 -0500

Why am I still receiving messages from this list when I unsubscribed twice
already?

Jon

----- Original Message -----
From: "Ingo Siebert" <ingo.siebert_at_cas.de>
To: <users_at_jax-ws.dev.java.net>
Sent: Thursday, July 20, 2006 4:15 AM
Subject: JAXB xsi:type problem


> Hi,
>
> i hope someone here can help me.
>
> I get a JAXB2 class cast exception in the second line. The
> creatObject-method has to return an Appointment, not the superclass
> DataObject.
>
> DataObject dataObject = service.createObject(APPOINTMENT);
> Appointment appointment = (Appointment) dataObject;
>
> My WSDL says, that an Appointment is a "sub-type" of DataObject. That's
> why the class Appointment extends DataObject. JAXB2/XJC created the class
> correctly. The WSDL contains:
>
> <xsd:complexType name="Appointment">
> <xsd:complexContent>
> <xsd:extension base="eimschemaataObject"> [...]
>
> But why does JAXB2 create an DataObject instead of an Appointment at
> run-time?
> The XML specifies the class by the XSI:TYPE attribute.
>
> Axis 1 as client ws technology is doing it correctly.
>
> That's the xml message:
>
> <ns2:createObjectResponse xmlns:ns2="http://schema.eim.de"
> xmlns:ns3="http://faults.eim.de">
> <ns2ataObject xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:type="ns2:Appointment">
> <ns2:id xsi:nil="true"/>
> <ns2:keyword xsi:nil="true"/>
> <ns2:startDate xsi:nil="true"/>
> <ns2:endDate xsi:nil="true"/>
> </ns2ataObject>
> </ns2:createObjectResponse>
>
> I tested it with JAXB2 final an the nightly build.
>
> Cheers,
>
> Ingo
> --
> CRM Products Development - New Technologies
>
> CAS Software AG
> Well informed. Always and everywhere.
> www.cas.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>