axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David R. Kraus (JIRA)" <>
Subject [jira] Created: (AXIS2-3956) Polymorphic object returned from POJO service method is serialized in reverse order than what is expected by client generated with wsdl2java (when subclass contains an array).
Date Thu, 31 Jul 2008 17:52:32 GMT
Polymorphic object returned from POJO service method is serialized in reverse order than what
is expected by client generated with wsdl2java (when subclass contains an array).

                 Key: AXIS2-3956
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
    Affects Versions: 1.2, 1.4
         Environment: Windows XP, Tomcat 5.0.28, Axis2 1.4, also Axis2 1.2.
            Reporter: David R. Kraus

Serialization code provided on the server side by Axis2, based on my POJO and its supporting
parameter/return objects, serializes a returned polymorphic object with subclass fields first,
followed by superclass fields, when the subclass contains an array.

The client code generated from the WSDL of this POJO based service (using wsdl2java-ADB),
serializes the polymorphic object in the reverse order with superclass fields preceding subclass
fields; and also expects that polymorphic objects received from the server follow this same
order. Since the server serializes in the reverse order "unexpected subelement" errors occur.

My assertion is that client serialization code, which is generated from POJO WSDL using wsdl2java,
should be consistent with POJO server serialization code.

More info below:

I deployed a simple web service as a POJO to both axis2 1.2 and axis2 1.4. This service basically
echoes back an object which demonstrates inheritance. In this example, MWSAttributeObjectInfo
is a subclass of MWSObjectInfo. To create the client I used wsdl2java (adb) against the deployed
POJO service WSDL.

When I invoked the echoAttrObjInfo method, which simply passes in MWSAttributeObjectInfo,
and receives the same MWSAttributeObjectInfo back, I received an "Unexpected subelement arrayAttributeForms"
in Axis2 1.2, and  "Unexpected subelement objCreationTime" in Axis2 1.4.

The client serialized the object to the server with MWSObjectInfo (superclass) fields first,
followed by subclass fields (rest of MWSAttributeObjectInfo - the array). The server responded
by passing back the object with the subclass fields first (the array), followed by superclass
fields (MWSObjectInfo). This caused an exception in the client. Axis2 1.2 detected that the
array shouldn't come first. Axis2 1.4 didn't see the error until after the array was processed,
getting an exception on the first field after the array(objCreationTime).

I tried a subclass with simple fields (no array), and no error was generated.
>From the WSDL:

<xs:element name="MWSObjectInfo" type="ax22:MWSObjectInfo" /> 
<xs:complexType name="MWSObjectInfo">
<xs:element name="objCreationTime" nillable="true" type="xs:string" /> 
<xs:element name="objDescription" nillable="true" type="xs:string" /> 
<xs:element name="objID" nillable="true" type="xs:string" /> 
<xs:element name="objIsHidden" type="xs:boolean" /> 
<xs:element name="objModificationTime" nillable="true" type="xs:string" /> 
<xs:element name="objName" nillable="true" type="xs:string" /> 
<xs:element name="objOwner" nillable="true" type="xs:string" /> 
<xs:element name="objParentFolderID" nillable="true" type="xs:string" /> 
<xs:element name="objPath" nillable="true" type="xs:string" /> 
<xs:element name="objState" type="xs:int" /> 
<xs:element name="objType" type="xs:int" /> 
<xs:element name="objVersion" type="xs:int" /> 

<xs:element name="MWSAttributeObjectInfo" type="ax22:MWSAttributeObjectInfo" /> 
<xs:complexType name="MWSAttributeObjectInfo">
<xs:extension base="ax22:MWSObjectInfo">
<xs:element maxOccurs="unbounded" name="arrayAttributeForms" nillable="true" type="ax22:MWSHierarchyAttributeFormInfo"

Soap Trace

Client Request sends MWSAttributeObjectInfo(array in subclass serialized at the end)..

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv=""><soapenv:Body><ns2:echoAttrObjInfo
<ns2:obj xmlns:s13="" xmlns:xsi=""
<s13:objDescription>generic test object</s13:objDescription>

Server Response echoes back same MWSAttributeObjectInfo object (array in subclass serialized

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv=""><soapenv:Body>
<ns:echoAttrObjInfoResponse xmlns:ns="">
<arrayAttributeForms xmlns="">
<arrayAttributeForms xmlns="">
<objCreationTime xmlns="">now</objCreationTime>
<objDescription xmlns="">generic test object</objDescription>
<objID xmlns="">DAVEKRAUS0002</objID>
<objIsHidden xmlns="">false</objIsHidden>
<objModificationTime xmlns="">later</objModificationTime>
<objName xmlns="">MWSAttributeObjectInfo</objName>
<objOwner xmlns="">Dave</objOwner>
<objParentFolderID xmlns="">FOLDERID</objParentFolderID>
<objPath xmlns="">objPath</objPath>
<objState xmlns="">1</objState>
<objType xmlns="">2</objType>
<objVersion xmlns="">1</objVersion>

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