Ticket #286 (new defect)
UnknownClassAlias: flex.messaging.messages.HTTPMessage
| Reported by: | thijs | Owned by: | nick |
|---|---|---|---|
| Priority: | major | Milestone: | Flex Messaging |
| Component: | Remoting | Version: | 0.3.1 |
| Keywords: | Cc: |
Description (last modified by thijs) (diff)
While trying the following code (see attached swf):
import mx.messaging.messages.HTTPRequestMessage; public function useRemoteObject():void { employeeRO = new RemoteObject(); employeeRO.destination = "GenericDestination"; employeeRO.setData.addEventListener("result", getListResultHandler); employeeRO.addEventListener("fault", faultHandler); var test:HTTPRequestMessage = new HTTPRequestMessage(); test.url = "http://google.nl"; employeeRO.setData(test); }
I'm getting this error:
File "/Users/thijstriemstra/Sites/pyamf/pyamf/trunk/pyamf/amf3.py", line 1067, in _getClassDefinition class_def = ClassDefinition(self.readString(), encoding=ref & 0x03) File "/Users/thijstriemstra/Sites/pyamf/pyamf/trunk/pyamf/amf3.py", line 548, in __init__ self.alias = pyamf.get_class_alias(alias) File "/Users/thijstriemstra/Sites/pyamf/pyamf/trunk/pyamf/__init__.py", line 807, in get_class_alias return load_class(klass) File "/Users/thijstriemstra/Sites/pyamf/pyamf/trunk/pyamf/__init__.py", line 743, in load_class klass = loader(alias) File "/Users/thijstriemstra/Sites/pyamf/pyamf/trunk/pyamf/__init__.py", line 968, in flex_loader raise UnknownClassAlias, alias UnknownClassAlias: flex.messaging.messages.HTTPMessage
And here's a patch that solves the problem:
class HTTPMessage(AbstractMessage): """ HTTP requests are sent to the HTTP endpoint using this message type. @ivar contentType: Indicates the content type of this message. @type contentType: C{str} @ivar method: Indicates what method should be used for the request. @type method: C{str} @ivar url: Contains the final destination for this request. @type url: C{str} """ def __init__(self, *args, **kwargs): AbstractMessage.__init__(self, *args, **kwargs) self.contentType = kwargs.get('contentType', None) self.method = kwargs.get('method', None) self.url = kwargs.get('url', None) for x in (RemotingMessage, ErrorMessage, CommandMessage, AcknowledgeMessage, AsyncMessage, HTTPMessage): pyamf.register_class(x, 'flex.messaging.messages.%s' % x.__name__, metadata=['amf3']) del x
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
