2009-10-31 5 views
0

도와 주시겠습니까? django-amf-gateway 응용 프로그램 (http://bitbucket.org/wolever/django-amf-gateway)을 사용하고 있습니다.Django + pyamf : actionscript 응용 프로그램에서 게이트웨이를 호출 할 때 이상한 예외가 발생했습니다.

나는 이런 식으로 게이트웨이를 정의 :

from django_amf_gateway import register_amf_service 
from goserver.models import Game 

class ChangeService(object): 
    def state(self): 
     game = Game.objects.get(id = 1) 
     return game.move_number 


register_amf_service('state', ChangeService, [Game]) 

을 내가 MXML에서 서비스 이런 식으로 전화했을 때 :

updateService.state(); 

<mx:RemoteObject id="updateService" endpoint="{Config.updateGateWay}" destination="state"> 
    <mx:method name="update" result="onSuccess(event)" fault="onFault(event)" /> 
</mx:RemoteObject> 

을 나는 예외 가지고 :

 
> [RPC Fault 
> faultString="[MessagingError 
> message='Destination 'state' either 
> does not exist or the destination has 
> no channels defined (and the 
> application does not define any 
> default channels.)']" 
> faultCode="InvokeFailed" 
> faultDetail="Couldn't establish a 
> connection to 'state'"] at 
> mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::invoke()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:263] 
> at 
> mx.rpc.remoting.mxml::Operation/http://www.adobe.com/2006/flex/mx/internal::invoke()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\remoting\mxml\Operation.as:197] 
> at 
> mx.rpc.remoting::Operation/send()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\remoting\Operation.as:113] 
> at 
> Function/http://adobe.com/AS3/2006/builtin::apply() 
> at 
> mx.rpc.remoting.mxml::Operation/send()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\remoting\mxml\Operation.as:170] 
> at 
> Function/http://adobe.com/AS3/2006/builtin::apply() 
> at 
> mx.rpc::AbstractService/http://www.adobe.com/2006/actionscript/flash/proxy::callProperty()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\AbstractService.as:290] 
> at 
> Game/main()[/Users/oleg/jin/goclub/trunk/goapp/usersList/src/Game.mxml:51] 
> at 
> Game/___Game_Application1_creationComplete()[/Users/oleg/jin/goclub/trunk/goapp/usersList/src/Game.mxml:3] 
> at 
> flash.events::EventDispatcher/dispatchEventFunction() 
> at 
> flash.events::EventDispatcher/dispatchEvent() 
> at 
> mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298] 
> at mx.core::UIComponent/set 
> initialized()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169] 
> at 
> mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718] 
> at 
> Function/http://adobe.com/AS3/2006/builtin::apply() 
> at 
> mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628] 
> at 
> mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568] 

답변

0

를 중 하나 mx : RemoteObject 메소드 이름이 잘못되었거나 파이썬 코드를 업데이트해야합니다 :

class ChangeService(object): 
    def update(self): 
     game = Game.objects.get(id = 1) 
     return game.move_number 

'상태'에서 '업데이트'로 변경되었습니다.

관련 문제