Title: RE: deserialisation problems with derived types
Hi Matthias,
It worked! Thanks a lot for your hint. This helps a lot!
Jan
-----Ursprüngliche Nachricht-----
Von: Matthias David [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 11. Dezember 2002 11:19
An: '[EMAIL PROTECTED]'
Betreff: RE: deserialisation problems with derived types

I ran into the same bug. -> Search the list for "Lost inherited attributes".
Here's a workaround. Fill in a "dummy" attribute in the subtype "eventtype" like this:

        <xsd:complexType name="eventType">
                <xsd:complexContent>
                        <xsd:extension base="KTAbstractTopicType">
                             <xsd:attribute name="dummy" type="xsd:int"/>
                         </xsd:extension>
                      </xsd:complexContent>
       </xsd:complexType>

This should fix your problem for now.

Matthias.

-----Original Message-----
From: Tegethoff, Jan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 10:54 AM
To: '[EMAIL PROTECTED]'
Subject: deserialisation problems with derived types


Hi all!
I have encountered the following problem: having used wsdl2java I have created stub-classes to deserialize a soap response. These stubs seem to be perfectly ok as they contain all necessary fields - however the deserialization does not work correctly, i.e. some attribute-fields don´t get filled (although there is no exception thrown). Those are the fields that are generated from the attributes of the complex type KTAbstractTopicType in the following excerpt, which is taken from the wsdl-file. Note that this type is abstract, meaning, that these fields are to be filled from derived types, such as 'eventType'. Could it be, that axis does not support this behaviour? Then the idea of extending types would be lost, so I guess, I am doing something wrong. Any suggestion will be greatly appreciated!

Jan
PS: The wsdl is mine, so I can alter it if necessary.
        <xsd:element name="topicMap">
                <xsd:complexType>
                        <xsd:sequence>
                                <xsd:element name="topic" type="KTAbstractTopicType" minOccurs="0" maxOccurs="unbounded"/>

                        </xsd:sequence>
                        <xsd:attribute name="lang" type="xsd:string"/>
                </xsd:complexType>
        </xsd:element>
        <xsd:complexType name="KTAbstractTopicType" abstract="true">
                <xsd:sequence>
                        <xsd:element name="topName" maxOccurs="unbounded">
                                <xsd:complexType>
                                        <xsd:sequence>
                                                <xsd:element name="base" type="KTtopicNameType"/>
                                                <xsd:element name="display" type="KTtopicNameType" minOccurs="0"/>
                                        </xsd:sequence>
                                        <xsd:attribute name="lang" type="xsd:string"/>
                                        <xsd:attribute name="icon" type="xsd:anyURI"/>
                                </xsd:complexType>
                        </xsd:element>
                </xsd:sequence>
                <xsd:attribute name="path" type="xsd:string"/>
                <xsd:attribute name="id" type="xsd:string" use="required"/>
                <xsd:attribute name="sumClfd" type="xsd:int" use="optional" default="0"/>
                <xsd:attribute name="sumAssoc" type="xsd:int" use="optional" default="0"/>
                <xsd:attribute name="expired" type="xsd:boolean" use="optional" default="false"/>
                <xsd:attribute name="handler" type="xsd:string" fixed="com.slb.taxi.tme.data.Topic"/>
        </xsd:complexType>
        <xsd:complexType name="eventType">
                <xsd:complexContent>
                        <xsd:extension base="KTAbstractTopicType"/>
                </xsd:complexContent>
        </xsd:complexType>

Reply via email to