Major Zend Amf updates for 1.8.4 release
Lots of changes made to Zend Amf made there way into Zend Frameworks next mini release for 1.8.4. I thought that I would run through the major changes. Special thanks to Stefan Klug for all of the patches that he produced! Absolutely grateful sir! This is probably the biggest update to the system since the first release. Please make sure that you test 1.8.4 before you push it into your production environment. Why? Well if your like me you probably built a couple work arounds for some of these bugs. Those work arounds may no longer work once the bug is fixed!
Major Changes
ZF-6641 Shared references are duplicated
ZF-6205 Serializer does not support cyclic references
ZF-6393 Wrong Amf0_Amf3 reference counting
ZF-5382 Multiple calls seems to break the deserializer.
ZF-6625 Zend Amf can load any instantiated PHP class. Security
Minor but significant changes
ZF-6975 Adobe Flash Builder 4 wizard now supports data types for introspection.
ZF-6992 Negative integers on 64 bit system is resolved.
ZF-6775 Unable to send Array’s from Blaze DS.
The 1.8.4 release has already been tagged and should come out sometime today 6/23/2009


Thanks Wade
Great work!
I downloaded the ‘latest version of zend amf, but when I go to run my site developed in flex me an error that did not gave me:
code: 0
Why?
Hi Wade,
after updating to 1.8.4 I have some trouble with autoloading classes and Zend_Amf. I used to add a directory to the server with $server->addDirectory() where my classes reside together with $autoloader->setFallbackAutoloader(true) in my bootstrap class. Now I have to add every class with $server->addClass() to not get exceptions thrown about not existing classes. Can you point me to a working example with autoloading?
Thanks in advance for your help.
Best regards,
Björn
Hello! It seems version 1.8.4 Zend Framework broke all my Zend_AMF applications.
Didn’t do anything too fancy, they work fine till 1.8.3 and now every service I call returns a AMF fault. No errors on the server side though!
Any clue what could be wrong ?
@pauo @alessio Did you use the full install of zend or just upload the AMF folder? The latest version requires the new Zend Loader or else you will get the errors that you mention.
Hi, i had the same problem as Paulo.
I use the addDirectory (that worked fine with 1.8.3) method for service that is now passing by zend loader pluginoader with addPrefixPath.
I noticed that all my classname where prefixed with ‘_’ (Hello_World => _Hello_World) and so i had an error with class (Hello_World) not found. To fix that i’ve just put if(prefix) before $prefix = $this->_formatPrefix($prefix); in (pluginloader class), so that when there is no prefix set like with zend amf, it does not prefix the class with ‘_’ and then it works again.
it’s not the best way but that’s the only way i found to fix the problem, is there a better way ?
Hi Wade!
I really appreciate your work but it’s kind of frustrating not getting a single answer to 2 mails and 1 tweet as I’m trying to contact you. Is there any chance of getting an answer on how service browser request responses have to be formatted?
Best regards
Felix
Hi Wade,
I’ve also upgraded to ZF 1.8.4.
No Idea what I’ve done? or what’s going on? but every service call I make I get a ‘Class “X” does not exist’ remoting fault.
I’ve even used require_once’s right above my Zend_Amf_Server instantiation. So I don’t see why Zend_Amf shouldn’t be able to see my classes?
N.B. I’ve used the full install.
Hope that helps.
Cheers,
Rob
Hi Wade,
I downgraded to ZF 1.8.3 and everything is now working fine for me.
Cheers,
Rob
@Felix, sorry for the delay. Unfortunately Zend Amf is not a paid project for me. I work on it as much as possible but still need to cover rent. THe service browser is in the queue but is dependent on better ArrayCollection support that what currently exists. Once that’s in place i’m sure i will work on the service browser. Donations can change priorities though!
@rob are you also using addDirectory ?
@wadearnold
yeah I am. Here’s a snippet of my code:
$server = new Zend_Amf_Server();
//$server->setSession();
$server->setProduction(false);
$server->addDirectory(APPLICATION_PATH . ‘/services’);
$response = $server->handle();
echo $response;
hey Wade, thanks for your answers.
I’m using the full package of the Zend Framework.
Here’s my AMF Broker code:
addDirectory( ‘/usr/share/php/services/’ );
//TODO: arranjar alternativa para este mapping explicito
require_once ‘/usr/share/php/lib/billing/BillingPairingMatrixVO.php’;
$server->setClassMap( ‘lib.billing.BillingPairingMatrixVO’, ‘BillingPairingMatrixVO’ );
require_once ‘/usr/share/php/lib/billing/OverrideComponentVO.php’;
$server->setClassMap( ‘lib.billing.OverrideComponentVO’, ‘OverrideComponentVO’ );
require_once ‘/usr/share/php/lib/billing/OverrideBillingVO.php’;
$server->setClassMap( ‘lib.billing.OverrideBillingVO’, ‘OverrideBillingVO’ );
print $server->handle();
?>
Another think I would like to know if there’s anyway of passing Objects from Flex to Zend_AMF without explicitly using the $server->setClassMap.
Thank you for your great job.
@Paulo Azevedo
For some reason most of my code was eaten. Is there any other place where we can discuss this ?
@wadearnold As already mentioned it would be great if services would be automatically detected but I’d be satisfied with an non-automatically detecting version. I already got the tree navigation working:
public function getServices() {
return array(array(’label’ => ‘CompanyService’, ‘data’ => ”));
}
The only problem is the service description page. I took a look at what AMFPHP generates and tried to generate similar output but it doesn’t work, e.g.:
public function describeService($data) {
return array(
array(
‘getAll’ => array(
‘description’ => ‘No description given.’,
‘arguments’ => array(),
‘access’ => ‘private’
)
),
”
);
}
Any tips?
Hi everybody,
same problem here. I also used addDirectory() which is no longer working. As a fix I now manually add every class with setClass().
Regards,
Björn
addDirectory resolution
http://wadearnold.com/blog/flash/zf-184-breaks-adddirectory
Hi Wade,
First of all, thanks for creating something as useful as Zend AMF Server.
I have a problem updating to anything above version 1.7.6 however as I then get the errormessage:
RPC Fault faultString=”Method “getMainKenmerken” does not exist” faultCode=”0″ faultDetail=”#0
Seeing the amount of bugfixes for Zend AMF I do need to update now it seems, since I also want to use circular references now. But this problem means I cannot get the new version (now 1.8.4) to run.
For adding the function to the server I currently use $server->setClass(”classname”);
I’m using Zend AMF to build a Flex interface that communicates with Ez Publish, which could be a complicating factor here. For one thing Ez Publish handles the autoloading of classes once a classname is used in the extension on the platform.
I wonder what changed between 1.7.6 and later versions that this stopped working for me, but still seems to work for most others?
If you need more details, feel free to ask, either here or by mail.
Greetings
Arnoud
To add to my comment, I’ve done some more testing and the setClass is not working outside of Ez Publish anymore either. I’ve just used a very small prototype that calls one simple method on a class I add to the server.
addFunction still works fine, so I can use that as a work around. But there’s no way I could can call functions on the server added through the setClass method.
Thanks WADEARNO
It really did worked.
Hello Wade,
Many thanks for a brilliant addition to the Zend Framework – we’re currently using it on our website quite a bit. However, since upgrade from Zend Frame 1.8.0 to 1.9.3PL1, we’ve had problems with the AMF side of things (in particular, the problem appears to have it’s roots in the difference between 1.8.3 and 1.8.4).
Basically, we have AMF calles with two DTO objects – one a generic “here I am” and the other a “here’s what needs to happen”. They both have a “sessionid”, “gameid” and “userid” in them, but the second object is not being populated with the details (sometimes due to Zend_Amf_Parse/Amf3/Deserializer readString’s “Undefined string refernece”). Is there any assistance you can provide? I can supply you with proxy recordings (which show the data is being transmitted to the server), example PHP/AMF code etc etc.
I am trying to look into it myself (as I know you only have so much free time to work on Zend), but it’s delving a lot deeper into AMF that I ever wanted to and hence it’s taking time. Thanks!