Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.8.1
-
Fix Version/s: None
-
Component/s: Zend_Amf
-
Labels:None
Description
Summary: , I'm sending a Java Primitive Array(String[]) in Java and it is going as Array Reference and this is not being deserialized correctly by the Zend PHP framework, however it works fine when I call this from a Flex Project, where an Array is sent and not Array Reference. (Attached are the images which show the AMF request being sent)
Description:
I have a php class which has a method as shown below.
public function testarray($arr)
{
return $arr;
}
I'm invoking this method using the AMFConnection class available as part of BlazeDS (flex.messaging.io.amf.client.AMFConnection), through the following code.
AMFConnection amfConnection = new AMFConnection();
amfConnection.setObjectEncoding(3);
amfConnection.setInstantiateTypes(false);
Object[] args = new Object[1];
args[0] = new String[]{"a","b"};
amfConnection.connect("http://localhost/phpproject/gateway.php");
RemotingMessage message = new RemotingMessage();
message.setMessageId(flex.messaging.util.UUIDUtils.createUUID());
message.setOperation("testArray");
message.setBody(args);
message.setSource("testPhp");
message.setDestination("GenericDestination");
returnValue = amfConnection.call(null, message);
The return value from the server is the argument that is passed, i.e. I should get the array with strings a,b, but I'm getting 0 as the arguments were not passed correctly