Re: Using RemoteObject component i.c.w. PyAmf - Django

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Using RemoteObject component i.c.w. PyAmf - Django

robbedoes
Hi Nick,

Since I got no response, I’ll repost my answer...

result="getpolls_resultHandler(event)" is causing tis error:

TypeError: Error #1034: Type Coercion failed: cannot convert mx.utils::ObjectProxy@12dacc59 to mx.messaging.messages.IMessage.

This is part of my mxml script:

protected function getpolls_resultHandler(event:ResultEvent):void{
pollCollection = event.result as ArrayCollection;
}

<s:RemoteObject id="test2"
destination="PollService"
fault="getpolls_faultHandler(event)">
<mx:method name="getPolls" result="getpolls_resultHandler(event)"/> 
</s:RemoteObject>

And this is my gateway.py

from pyamf.remoting.gateway.django import DjangoGateway
import pyamf
from pyamf import amf3
from django.core.exceptions import ObjectDoesNotExist

from polls.models import Poll
amf3.use_proxies_default = True
pyamf.register_class(Poll, 'valueObjects.Poll')

def getPolls(request):
    return Poll.objects.all()

gw = DjangoGateway({
     "PollService.getPolls": getPolls,
})


The strange thing is that I get results when I use a NetConnection.

connection = new NetConnection;
connection.connect("http://127.0.0.1:8000/gateway/");
connection.call("PollService.getPolls", new Responder(onResult_polls, onFault_polls));

But then 

private function onResult_polls(data:Object):void

is using a data:Object


_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Using RemoteObject component i.c.w. PyAmf - Django

Nick Joyce
Hey Minox,

Can you capture the HTTP request/response that is causing the error - perhaps I can spot something from there?

I generally use Charles - http://charlesproxy.com to do such things.

This will be the most useful way to solve this problem.

Cheers,

Nick

On 9 Nov 2010, at 03:29, Minox Taurus wrote:

Hi Nick,

Since I got no response, I’ll repost my answer...

result="getpolls_resultHandler(event)" is causing tis error:

TypeError: Error #1034: Type Coercion failed: cannot convert mx.utils::ObjectProxy@12dacc59 to mx.messaging.messages.IMessage.

This is part of my mxml script:

protected function getpolls_resultHandler(event:ResultEvent):void{
pollCollection = event.result as ArrayCollection;
}

<s:RemoteObject id="test2"
destination="PollService"
fault="getpolls_faultHandler(event)">
<mx:method name="getPolls" result="getpolls_resultHandler(event)"/> 
</s:RemoteObject>

And this is my gateway.py

from pyamf.remoting.gateway.django import DjangoGateway
import pyamf
from pyamf import amf3
from django.core.exceptions import ObjectDoesNotExist

from polls.models import Poll
amf3.use_proxies_default = True
pyamf.register_class(Poll, 'valueObjects.Poll')

def getPolls(request):
    return Poll.objects.all()

gw = DjangoGateway({
     "PollService.getPolls": getPolls,
})


The strange thing is that I get results when I use a NetConnection.

connection = new NetConnection;
connection.connect("http://127.0.0.1:8000/gateway/");
connection.call("PollService.getPolls", new Responder(onResult_polls, onFault_polls));

But then 

private function onResult_polls(data:Object):void

is using a data:Object

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users