Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 1.7.5
-
Fix Version/s: Next Mini Release
-
Component/s: Zend_Amf
-
Labels:None
Description
We use gateway.php as endpoint for Remoting Calls from Flash player.
In order to expose a php file as a service we need to include it in the gateway.php file.
Strongly typed objects(class objects) when sent either from client side or server side do not work till we specify a classMapping on gateway.php
Something similar to:
$server->setClassMap('Entity', 'Entity');
Flex already has a remoteClass alias tag as a metadata on the client side classes which specifies its type on the server side.
Example:
package
{
[RemoteClass(alias="Entity")] // this is server side type
public class Entity
}
This data is used while serializing and de-serializing the object.
So, Zend should not be requiring this mapping on the server, as it is assumed that the client will always send the data with the same typing as on the server.
If there is any other reason of keeping this mapping on gateway.php, at least the default behavior should be the one which is mentioned above for no mappings.
Also, otherwise, the $explicitType variable in php classes provide the information about the type on the server. This variable if not specified make the strong typed objects as generic objects when sent to the client. This should also default to the class name if it is not specified, and should work as strongly typed objects on either side.
Attachments
Issue Links
| This issue depends on: | ||||
| ZF-9809 | Instantiate DAO before parsing of AMF Body. |
|
|
|
I've changed the serializer methods so that they will return class name and not empty for unknown classes, unless the class is stdClass (which will be just Object).
Wade, if you could add test for that (I'm not sure how it's best to do it) that'd be great.