incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joris Timmerman (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FLEX-63) SOAPDecoder: polymorphism problem
Date Wed, 23 May 2012 12:17:40 GMT
Joris Timmerman created FLEX-63:
-----------------------------------

             Summary: SOAPDecoder: polymorphism problem
                 Key: FLEX-63
                 URL: https://issues.apache.org/jira/browse/FLEX-63
             Project: Apache Flex
          Issue Type: Bug
            Reporter: Joris Timmerman
            Assignee: Bertrand Delacretaz



Usecase:
--------------
The server specifies a base-class as the return type of a method in the WSDL with the intention
of sending sub-classes of that type in the response of this method.
The actual type of the response object is defined in the xsi:type="" argument in the response
xml.

Problem:
-------------
The SOAPDecoder returns an instance of the base class, instead of the specified sub-class.

In the SOAPDecoder, the method decodeType() is overriden from the XMLDecoder (line 765).
The first step in this method is a lookup of the actual type of the object it needs to decode,
thanks to this, it actually uses the correct WSDL template to decode against.
The parent object however, the object which we're decoding properties of, is instantiated
in the XMLDecoder.
Because the XMLDecoder doesn't look up the actual type, an instance of the base-class is created.

Solution:
-------------
1. In the SoapDecoder, override the XMLDecoders decode()-method.
2. Look up the xsi:type in the response xml, if none found use the type set in the wsdl.

Patch:
----------
Project: RPC
Class: SOAPDecoder

Insert code:
override public function decode(xml:*, name:QName=null, type:QName=null, definition:XML=null):*
{
	var xsiType:QName = getXSIType(xml);
	return super.decode(xml, name, (xsiType != null) ? xsiType : type, definition);
}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message