axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andre Rothe (JIRA)" <>
Subject [jira] [Created] (AXIS-2914) Wrong deserialization of arrays
Date Wed, 18 May 2016 13:09:12 GMT
Andre Rothe created AXIS-2914:

             Summary: Wrong deserialization of arrays
                 Key: AXIS-2914
             Project: Axis
          Issue Type: Bug
          Components: Serialization/Deserialization
    Affects Versions: 1.4
         Environment: Java 1.8.0_66
            Reporter: Andre Rothe

An external webservice returns a message

<?xml version="1.0" encoding="UTF-8" standalone="no"?><soapenv:Envelope xmlns:soapenv=""
xmlns:xsd="" xmlns:xsi=""><soapenv:Header><ns1:wosid
xmlns:ns1="" xmlns:soapenc=""
soapenv:actor="" soapenv:mustUnderstand="0" xsi:type="soapenc:string">KMN8CSp2A5BOd0OOOPizng</ns1:wosid><ns2:woinst
xmlns:ns2="" xmlns:soapenc=""
soapenv:actor="" soapenv:mustUnderstand="0" xsi:type="soapenc:string">1</ns2:woinst></soapenv:Header><soapenv:Body><ns3:projectDataResponse
xmlns:ns3="" soapenv:encodingStyle=""><projectDataReturn
xmlns:ns4="" xsi:type="ns4:ProjectDataResult"><errorCode
xsi:type="xsd:int">0</errorCode><message xmlns:soapenc=""
xsi:nil="true" xsi:type="soapenc:string"/><statusCode xsi:type="xsd:int">1</statusCode><project
xmlns:soapenc="" xsi:type="soapenc:string">ZKS</project><centres
xmlns:ns5="" xsi:type="ns5:CentreBean"><name xmlns:soapenc=""
xsi:type="soapenc:string">Center 1</name></centres><centres xmlns:ns6=""
xsi:type="ns6:CentreBean"><name xmlns:soapenc=""
xsi:type="soapenc:string">Center 2</name></centres></projectDataReturn></ns3:projectDataResponse></soapenv:Body></soapenv:Envelope>

But the Array contains only the last CentreBean object. I have seen in the code, that the
set() method of the BeanPropertyDescriptor overwrites the previous CenterBean object in the
target array. The object is casted to CentreBean[] with one entry and it is stored on the
same place as the first CenterBean.

It seems, that it should be necessary to use an index property value greater than 0 to access
the right set() method (the one which can handle arrays), but the index is always -1, and
so it will use the simple one.

Within the DeserializerImpl.class I have a CentreBean.class as value object within the valueComplete()
method (which is called after the endElement event during the XML parsing). The first call
to the BeanPropertyDescriptor.set() throws an exception because the object type must be an
array. After JavaUtils.convert() I have the right type, but the set() method doesn't recognize,
that there is a value already stored within the BeanPropertyDescriptor. So the result will
hold only the last one.

Is this a problem with the deserializer or is there a problem with the Webservice description?

This message was sent by Atlassian JIRA

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

View raw message