I do not know about the non-ascii text. On the web2py side just call
pyamf so if there is any bug in implementing the protocol it is there.

It should be possible to change amf0 to amf3. Try change gluon/
tools.py line 2083

        context = pyamf.get_context(pyamf.AMF0)

Perhaps you can help me with something. Consider these two articles:
http://www.web2py.com/AlterEgo/default/show/22
http://www.web2py.com/AlterEgo/default/show/232

There is only one difference in the flash code:
< service = new Service("http://localhost:8000/pyamf_test/default/
gateway", null, "addNumbers", null, null);
> service = new Service("http://localhost:8000/pyamf_test/default/gateway";, 
> null, null, null, null);

that is because @service.amfrpc does not define a namespace while then
"manual" gateway does.
Is this a problem? Is this compatible with the specs? should we allow
for a namespace? For example

     @service.amfrpc.namespace

or

     @service.amfrpc(namespace)

Massimo


On Jun 27, 3:07 am, Alexei Vinidiktov <alexei.vinidik...@gmail.com>
wrote:
> You can use this code from Flex. I did and it worked with a caveat of
> not being able to send non-ASCII text.
>
> Here's the code I used. It's ugly, but it was put together with the
> sole purpose of doing some tests.
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
>                                horizontalAlign="center" verticalAlign="middle"
>                                backgroundColor="#FFFFFF" backgroundAlpha="0">
>
> <mx:Form label="Login">
>
> <mx:FormItem label="Create Project"/>
> <mx:FormItem label="name:">
>        <mx:TextInput id="name_txt"/>
> </mx:FormItem>
> <mx:FormItem label="description:">
>        <mx:TextInput id="description_txt"/>
> </mx:FormItem>
> <mx:FormItem label="summary:">
> <mx:TextInput id="summary_txt"/>
> </mx:FormItem>
> <mx:FormItem label="type:">
>        <mx:TextInput id="type_txt"/>
> </mx:FormItem>
> <mx:FormItem label="owner_id:">
>        <mx:TextInput id="owner_id_txt"/>
> </mx:FormItem>
>
> <mx:FormItem horizontalAlign="right" paddingBottom="10">
>        <mx:Button label="Submit" click="submit(event)"/>
> </mx:FormItem>
>
> <mx:Text id="status_txt" textAlign="center" fontWeight="bold"
>                 width="250" height="100"/>
> </mx:Form>
>
>        <mx:Script>
>        <![CDATA[
>                        import flash.net.NetConnection;
>                        import flash.net.Responder;
>
>                        // Gateway connection object
>                            private var gateway:NetConnection;
>
>                        // submit action
>                public function submit( event:MouseEvent ): void
>                {
>                        var name:String = name_txt.text;
>                        var description:String = description_txt.text;
>                        var summary:String = summary_txt.text;
>                        var type:String = type_txt.text;
>                        var owner_id:String = owner_id_txt.text;
>
>                    // Setup connection
>                    gateway = new NetConnection();
>
>                    // Connect to gateway
>                    gateway.connect(
> "http://localhost:8000/rpc/default/call/amfrpc";);
>
>                    // Set responder property to the object and methods
> that will receive the
>                    // result or fault condition that the service returns.
>                    var responder:Responder = new Responder( onResult, onFault 
> );
>
>                    // Call remote service.method: call(function.
> responder, param1, param2)
>                    gateway.call( "f", responder, name, description, summary );
>
>                }
>
>                // Result handler method
>                private function onResult( result:* ): void
>                {
>                    var myData:String = result;
>                    trace( myData );
>                    status_txt.text = "Success: data = " + myData;
>                }
>
>                // Fault handler method displays error message
>                private function onFault( error:* ): void
>                {
>                    // Notify the user of the problem
>                    status_txt.text = "Remoting error:";
>                    for ( var d:String in error ) {
>                       status_txt.text += error[d] + "\n";
>                    }
>                }
>        ]]>
>        </mx:Script>
>
> </mx:Application>
>
>
>
> On Sat, Jun 27, 2009 at 3:10 PM, Nano Surbakti<nano.surba...@gmail.com> wrote:
>
> > Hi Massimo,
>
> > I couldn't try that code, cause I don't have Adobe Flash MX. I am
> > using Flex, trying something quite similar to Alexei's code. It's
> > actually adapted from:
> >http://pyamf.org/browser/examples/trunk/helloworld/flex/remoteobject/...
> > For the controller, I'm following :
> >http://www.web2py.com/AlterEgo/default/show/232
>
> > Btw, I'm new to web2py, trying to use this cool framework for a project.
>
> > --
> > Nano Surbakti
>
> > On Sat, Jun 27, 2009 at 12:53 PM, mdipierro<mdipie...@cs.depaul.edu> wrote:
>
> >> This could be a bug. Could you try if this works for you?
>
> >>http://www.web2py.com/AlterEgo/default/show/232
>
> >> Massimo
>
> >> On Jun 26, 10:27 pm, nanotalk <nano.surba...@gmail.com> wrote:
> >>> Has anybody could get this work? I am stucked in the same problem
> >>> here .. :(
> >>> Is it a bug, or something?
>
> >>> --
> >>> Nano Surbakti
>
> >>> On May 29, 5:07 am, roblund <robert.s.l...@gmail.com> wrote:
>
> >>> > It appears that this has not been answered yet, so I will bump it back
> >>> > to the top. I am interested in seeing any examples people have. Has
> >>> > anybody successfully implemented @service.amfrpc and used a
> >>> > mx:RemoteObject on the flex side? I was able to get @service.amfrpc
> >>> > working correctly with a NetConnection on the flex side, but this
> >>> > seems to be considered the old way of using amf. I thread I used for
> >>> > an example of NetConnection 
> >>> > was:http://groups.google.com/group/web2py/browse_thread/thread/1c6f94c269...
>
> >>> > Thanks,
> >>> > Rob Lund
>
> --
> Alexei Vinidiktov
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to