request for help

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

request for help

robbedoes
Hi folks,

I’m trying to combine several examples to get a running app using Flash Builder, PyAmf and Django.
But I keep get this message when launching the flex app

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

When I run python_test.py against the server I get a result.

This is part of my mxml script:

<s:RemoteObject id="test2"
destination="EmployeeService"
fault="test2_faultHandler(event)">
<mx:method name="getEmployees" result="test2_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 employees.models import Employee
amf3.use_proxies_default = True
pyamf.register_class(Employee, 'valueObjects.Employee')

def getEmployees(request):
    return Employee.objects.all()

import logging 
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s') 

gw = DjangoGateway({
     "EmployeeService.getEmployees": getEmployees,
}, logger=logging)


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("EmployeeService.getEmployees", new Responder(onResult_employees, onFault_employees));

Can someone tell me what’s wrong?

Cheers,

Rob

 


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