Search the web
Sign In
New User? Sign Up
flexcoders · RIA Development with Adobe Flex
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Browser to Flex Debugger connection   Message List  
Reply | Forward Message #58590 of 150106 |
Amfphp with AMF3 support: testers wanted

Hi all,

I've finally gotten around to add AMF3 support to amfphp, so you can
finally use Flex 2's RemoteObject with it. To test the new features,
I've created a new Service Browser in Flex 2 which allows you to
introspect services and test methods on the fly. I need people to test
out the new AMF3 support.

New/changed features:

- $this->methodTable is DEAD. All methods in /services are now
considered remotely accessible, unless you set them to protected or
private (PHP5) or start the method name with an (_), in which case it
will throw an error. If you want to get a description of a method and
it's arguments without looking at the class itself, add JavaDoc to the
method and you should see it in the new Service Browser.
- _authenticate is dead, as a side-effect of the removal of the
methodTable. You can secure methods by creating a special function
called "beforeFilter($methodName)" in your class and return false to
stop a method from being executed. (the _ and the beforeFilter are the
conventions used by CakePHP, so I figured I'd use those instead of
rolling my own).
- Circular references in AMF0 and AMF3 should now work. Class mapping
code has been ported to the AMF3 code also. To use remote class mapping,
use registerClassAlias or the [RemoteClass] metadata tag, then read the
instructions in advancedsettings.php
- Returning a mysql_query will now return either an Array or an
ArrayCollection depending on the setting in gateway.php. Other database
types are currently unsupported in AMF3 mode (they will be supported as
soon as I am sure the AMF3 code is perfect).
- You can send ByteArray, ArrayCollection and ObjectProxy instances as
arguments to remote methods. You will receive the result as a string, as
the inner array and as the inner object, respectively. Currently there
is no way to send back these types to Flash, but there will be in the
next version.
- /browser now brings up the brand spanking new Flex 2-based service
browser. You can test methods directly through it. If the method returns
an array or arraycollection, the browser will attempt to show it in a
datagrid (sweet). Please feel free to modify servicebrowser.mxml (it's
very spaghetti-code-ish, but it works). You will need the Adobe corelib
to compile (google for the link)

Limitations/things to keep in mind:

- MySql works but not other databases
- You can use a JSON string for arguments in the service browser.
However you must wrap object keys in quotes (a limitation of Adobe corelib).
- Paged recordsets don't work anymore
- Only tested in PHP5. PHP4 might show issues with circular references.
- Calling two methods on a remoteObject one after the other (during the
same frame) might not work.
- Charles and ServiceCapture have some issues with AMF3 handling. You
might see strings which seem out of place in your output while it works
fine in Flash. I will notify the people involved. You might want to set
PRODUCTION_SERVER to true in gateway.php if this is a recurrent problem,
in the meantime.
- If you need to send to Flash a class and want it to be mapped to a
class in a package, you need to add a key to the class called
_explicitType with a value of "com.mypackage.TheClass" and use
registerClassAlias or [RemoteClass] as usual ( a limitation of php not
supporting packages)

All that being said, I need testers. Please download it here:

http://5etdemi.com/uploads/amfphp-1.9.alpha.zip

(although it states it is amfphp 1.9, there will be no amfphp 1.9.
amfphp 2.0 will be amfphp 1.9 + JSON and possibly XML-RPC)

If you run into any issues, please either:

- Create a minimal test case which shows the reproducible bug, then send
it to me.
- In gateway.php, uncomment $gateway->logIncomingMessages and
logOutgoingMessages, create an in and an out folder and run it again.
Then send the log files (*.amf) to me.

Please send the feedback to pm AT 5etdemi DOT com. I am confident it
should be pretty stable, as most of the new code is lifted from
Fluorine, but you never know. Once I am 100% sure the amf 3 code is
bulletproof I will release another version with some publicity on the
blog and the homepage (currently keeping the new code low-profile).

Thanks,

Patrick



Tue Dec 12, 2006 12:01 am

pmineault2
Offline Offline
Send Email Send Email

Forward
Message #58590 of 150106 |
Expand Messages Author Sort by Date

Hi all, After compiling my app using the sdk with arg -debug=true i then tried to open the html file in the browser and get the message. "Where is your...
bjorn.schultheiss
bjorn.schult...
Offline Send Email
Dec 11, 2006
11:06 pm

Hi all, I've finally gotten around to add AMF3 support to amfphp, so you can finally use Flex 2's RemoteObject with it. To test the new features, I've created...
Patrick Mineault
pmineault2
Offline Send Email
Dec 12, 2006
1:26 am

Hey Patrick I have a pretty heavy app that uses amf0/php so I will give this a run. It's not a production app so this will be perfect! Peace, Mike ... -- Teoti...
Michael Schmalle
teotigraphix
Offline Send Email
Dec 12, 2006
3:00 am

Patrick, Nice! I have taken the code and created some quick examples. They can be found here: http://renaun.com/flex2/posts/AMFPHP1_9Example.html ...
Renaun Erickson
kaibabsowats
Offline Send Email
Dec 13, 2006
12:15 am

Nice stuff Renaun! A couple things: in the mx:RemoteObject tag you could declare an mx:method and have result and fault bound to the method and not to the ...
Patrick Mineault
pmineault2
Offline Send Email
Dec 13, 2006
12:54 am

Patrick, The examples I created were done quick and are used as my initial test apps for AMF0/3 backends. They are very basic and do not mean to show any...
Renaun Erickson
kaibabsowats
Offline Send Email
Dec 13, 2006
5:17 am

Hello, I am able to do a stand-alone .mxml project using the samples you have provided and connect well to my php methods / backend database. The issue I have...
Jamie O
realdolljamie
Offline Send Email
Dec 18, 2006
9:35 pm

Could you post the services_config.xml file you have? Patrick...
Patrick Mineault
pmineault2
Offline Send Email
Dec 19, 2006
4:20 am

For the stand-alone basic .mxml I used a copy of the basic example Renaud gave - with a different URL for the gateway which is located on a separate server....
Jamie O
realdolljamie
Offline Send Email
Dec 19, 2006
5:03 am

Dang. I really don't know what to tell you man, it looks like everything is in order. Unfortunately the services config file format is little documented and...
Patrick Mineault
pmineault2
Offline Send Email
Dec 19, 2006
6:12 am

I also think the services config format is a bit cryptic, at the least lacking clear documentation on all the adapter/channel configuration options. Renaun ......
Renaun Erickson
kaibabsowats
Offline Send Email
Dec 19, 2006
7:26 am

Jamie, You can try putting the the adapter in the remoting-config.xml. Leave the channel in the services-config.xml. ColdFusion's default remoting ...
Renaun Erickson
kaibabsowats
Offline Send Email
Dec 19, 2006
7:24 am

Hey, Much like a virgin learning to navigate the salacious curves of his first partner, I've tried putting it everywhere and had little success. Typo's aside,...
Jamie O
realdolljamie
Offline Send Email
Dec 19, 2006
3:48 pm

I've never been so happy to realize I made such a stupid mistake! The subsequent error was related to a web service that I had somehow put an...
Jamie O
realdolljamie
Offline Send Email
Dec 19, 2006
4:52 pm

Awesome. Could you post your findings on a blog or something for future reference? Patrick...
Patrick Mineault
pmineault2
Offline Send Email
Dec 19, 2006
8:28 pm

Jamie, The RemoteObject (client side) found in my example is the same code used for Cairngorm or non-Cairngorm applications. Flex 2.0 and AMF3 (not sure where...
Renaun Erickson
kaibabsowats
Offline Send Email
Dec 19, 2006
7:18 am

Yo, I got the command-line debugger working, but is there anyway to hook into FB2 debugger? Bjorn...
Bjorn Schultheiss
bjorn.schult...
Offline Send Email
Dec 12, 2006
2:42 am

Just opening the HTML file isn't enough to begin a debugging session. When you click Flex Builder's "debug" icon, Flex Builder does two things: It launches...
Mike Morearty
mike_morearty
Offline Send Email
Dec 12, 2006
5:45 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help