axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mehmet Döngel (JIRA) <>
Subject [jira] Created: (AXIS2-3418) Unexpected subelement - pojo - Inherited Complex Type
Date Wed, 26 Dec 2007 10:58:43 GMT
Unexpected subelement - pojo - Inherited Complex Type

                 Key: AXIS2-3418
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb
    Affects Versions: 1.3
         Environment: jdk jdk1.5.0_14, axis2 1.3, Fedora 8, Intel x86
            Reporter: Mehmet Döngel

$AXİS2_HOME/samples/pojo   sample,
I created ZEntry class with "String custom" field and updated Entry class to extend ZEntry
class, after deployment I build and run adb client and got 
org.apache.axis2.databinding.ADBException: Unexpected subelement city 


Response Message:
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="">
        <ns:findEntryResponse xmlns:ns="http://service.addressbook.sample">
            <ns:return xmlns:ax21="http://entry.addressbook.sample/xsd" type="sample.addressbook.entry.Entry">
                <ax21:city>Sesame City</ax21:city>
                <ax21:name>Abby Cadabby</ax21:name>
                <ax21:state>Sesame State</ax21:state>
                <ax21:street>Sesame Street</ax21:street>
                <ax21:custom xmlns:xsi="" xsi:nil="true"/>

Reason for that exception is  that generated stub expects first "custom" element because schema
for Entry and ZEntry class in  wsdl is :

        <xs:schema xmlns:ax21="http://entry.addressbook.sample/xsd" attributeFormDefault="qualified"
elementFormDefault="qualified" targetNamespace="http://entry.addressbook.sample/xsd">
            <xs:complexType name="ZEntry">
                    <xs:element minOccurs="0" name="custom" nillable="true" type="xs:string"/>
            <xs:complexType name="Entry">
                    <xs:extension base="ax21:ZEntry">
                            <xs:element minOccurs="0" name="city" nillable="true" type="xs:string"/>
                            <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
                            <xs:element minOccurs="0" name="postalCode" nillable="true"
                            <xs:element minOccurs="0" name="state" nillable="true" type="xs:string"/>
                            <xs:element minOccurs="0" name="street" nillable="true" type="xs:string"/>

Reason for expected response (first Entry fields (city,name,postalCode,state,street) and then
super class ZEntry fields (custom) ) is   BeanUtil class takes all the fields and put to an
arraylist and then sort that array list. Because ZEntry.custom field comes after
fields,custom element is serialized last.

When I use AEntry class instead of ZEntry class, no problem occurs.

My solution to this problem is changing BeanUtil class in such a way that,  first get super
class properties and sort that properties and then put to an arrayList containing all properties,
and after that get sub class properties and sort that properties and then put to that arrayList.

Any other ideas, solutions?

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message