Flex 2 RemoteObject with AMFPHP supporting AMF3

December 12th, 2006

Patrick Mineault has created an alpha update of AMFPHP that now supports AMF3. He is looking for people to test it out. To help with this I have created two simple examples that I have running live on a PHP4/Apache server, as well as have tested on a PHP5/Windows box.

Basic Example
Return Array of VO’s Example

You can download the source for both examples by right clicking on the apps or get it here.

Note: To make the amfphp 1.9 alpha code to work with PHP4 there you need to implement a different function for the array_search() when the search needle is a object.

Entry Filed under: Adobe Flex, Flex,AMF,PHP, Rich Internet Applications

14 Comments Add your own

  • 1. Leonardo França » &hellip  |  2006-12-13 at 5.31 am

    [...] Renaun http://renaun.com/blog/2006/12/12/166/ [...]

  • 2. luchyx  |  2006-12-15 at 12.44 pm

    Hi renaun
    Can you give some suggestion to get work the -service config with your remote object. ?
    I’ve got this command “-locale en_US -services services-config.xml” in my project but the endpoint is not replaced.
    I’m using php4, amfphp0 and .

    Best’s

  • 3. Renaun Erickson  |  2006-12-15 at 12.51 pm

    Luchyx,

    You are almost there, use the source from my xml config file.

    In my example i was using a file called “amfphp19-services-config.xml”. In the mxmlc compile arugments list I add “-services amfphp19-services-config.xml”.

    You can find the source here:
    http://renaun.com/flex2/posts/amfphp1_9/index.html

  • 4. luchyx  |  2006-12-17 at 5.13 pm

    Yes I’m was reading the doc’s and your examples; looks easy but I don´t know what happens.
    I’m using cairgorm 2.1. Did you try with it ?
    // I can’t paste directly the mxml source, I hope the html work!.

    <cairngorm:ServiceLocator>
    <rpc:RemoteObjectAMF0 endpoint="http://localhost/amfphp/gateway.php"
    destination="userService"
    id="usersServices" makeObjectsBindable="true"
    source="com.ria.CategoryManager" requestTimeout="30" showBusyCursor="true"/>
    </cairngorm:ServiceLocator>

    And in the services-config.xml I modify the endpoint

    <destination id="userService">
    <channels>
    <channel ref="amfphp"/>
    </channels>
    <channels>
    <channel-definition id="amfphp" class="mx.messaging.channels.AMFChannel">
    <endpoint uri="http://otherhost/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
    </channel-definition>
    </channels>

    The endpoint never change according the service-config.xml, Weird.!

    Thanks a lot.
    Luchyx

  • 5. Renaun Erickson  |  2006-12-17 at 5.33 pm

    With AMF3 support you do not need to use the RemoteObjectAMF0 but use the normal Flex RemoteObject.

    You can set the endpoint through the compile -services argument or specify the endpoint in each RemoteObject. The compiler method is the standard but not necessary a have to.

  • 6. Wade Arnold  |  2007-01-02 at 11.47 pm

    Renaun, I was hoping that in your second example you would actually use a delegate and have it follow cairgorm. Any chance for us getting a good example of Service Locater?As always thanks!

  • 7. Suresh  |  2007-01-04 at 11.50 am

    Renaun,

    Is there a good tool for us Java folks, other than Flex FDS. OpenAMF has non-existent documentation and I am not sure if it supports AMF3.

  • 8. Renaun Erickson  |  2007-01-04 at 12.27 pm

    Short answer not really

    Possibilities:
    Red5 (not complete feature set, more Flash Media Server)
    WebORB from midnight coders (.NET implementation and other languages coming)

  • 9. Stefan Schmalhaus  |  2007-04-28 at 5.04 am

    Since _authenticate() and roles have been removed from AMFPHP 1.9 I don’t know how to secure my remote services. How can I read the setCredentials() header in 1.9?

  • 10. Renaun Erickson  |  2007-04-28 at 8.55 am

    not sure, it should be readable out of the headers like you are referring too.

  • 11. Stefan Schmalhaus  |  2007-04-29 at 12.09 am

    If I were able to read the credentials header in AMFPHP 1.9 I could probably set up my own authentication procedure. But I don’t know where to patch Patrick’s scripts.

  • 12. Dan Van Brunt  |  2008-05-23 at 5.36 pm

    Great work Renaun. Your site has been very helpful to me. I’m new to Flex and I seem to be having a bit of difficulty finding good examples.

    I your “Flex 2 RemoteObject with AMFPHP supporting AMF3″ example…however…do you/ or anyone else….know of an example that shows not only passing VOs from PHP to AS3 but also the reverse?

  • 13. Renaun Erickson  |  2008-05-28 at 11.13 am

    The reverse requires the PHP class to be part of the gateway.php’s “setClassMappingsPath()” so when AMFPHP tries to deserialize the AMF code defined by the AS3 class it can find a class to map too.

    Here is a link that explains it:

    http://xypyy2.blogspot.com/2008/01/mapping-vos-from-flex-to-php-using.html

  • 14. Sandip  |  2008-06-15 at 12.53 am

    I need help or may be tutorial on flex + cairngorm + red5 + java

    Can anybody help me with the basic example.

    My remoteobject in red 5 is not wrking in cairngorm. Otherwise it works

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Disclaimer: I work as a Flash/Flex Developer for Adobe Systems Incorporated. The opinions expressed here represent my own and not those of my employer.

My Amazon.com Wish List

Calendar

December 2006
S M T W T F S
« Nov   Jan »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Most Recent Posts


Flex.org - The Directory for Flex