Quantcast

Re: users Digest, Vol 36, Issue 6

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: users Digest, Vol 36, Issue 6

robbedoes
Hi Nick,


# Do I need the next line??
pyamf.register_class(Location, 'com.subscription.vos.LocationVO')

It depends. If you want the objects that are reassembled to be weakly typed then no, you don't need this. However if you want all Python Location instances to be built as specific classes in Flex/Flash, yes.

Okay, I understand.

All looks good so far.

After changing the 'com.subscription.vos.LocationVO' to 'com.meterstanden.vos.LocationVO' the scripts are at least working.
I can't however use amf3.use_proxies_default = True because Flash throws an error in:

private function onGetLocationsSuccess(event:ResultEvent):void

TypeError: Error #1034: Afgedwongen typeomzetting is mislukt: kan mx.utils::ObjectProxy@1b6ff7c1 niet omzetten in mx.messaging.messages.IMessage.

If I leave amf3.use_proxies_default = True out of the script the function works but I have to use this:

private function onGetLocationsSuccess(event:ResultEvent):void
{
_locationlist = new ArrayCollection( event.result as Array);

}


I've seen a ticket for this but I don't know if it is really fixed in PyAMF-0.6b2-py2.6?

These are the request and response using amf3.use_proxies_default

AMF Request: <Envelope amfVersion=3>
 (u'/1', <Request target=u'null'>[<CommandMessage  body={} timestamp=0 destination='' clientId=None headers={'DSMessagingVersion': 1, 'DSId': u'nil'} timeToLive=0 messageRefType=None messageId=u'7A74501B-844A-0721-F074-403A0313851F' operation=5 correlationId='' />]</Request>)
</Envelope>
AMF Response: <Envelope amfVersion=3>
 (u'/1', <Response status=/onResult><AcknowledgeMessage  body=True timestamp=1289567732 destination=None clientId='2e9da75a-ff58-4dd8-bfb3-72152e5ee1a9' headers={} timeToLive=None messageId='61ea065b-eeeb-4292-823b-b2fa6847f506' correlationId=u'7A74501B-844A-0721-F074-403A0313851F' /></Response>)
</Envelope>

These are the request and response without  using amf3.use_proxies_default 

AMF Request: <Envelope amfVersion=3>
 (u'/2', <Request target=u'null'>[<RemotingMessage  body=[] source=None timestamp=0 destination=u'meterstandenservice' clientId=None headers={'DSId': u'nil', 'DSEndpoint': u'pyamf'} timeToLive=0 messageId=u'9C757C92-191F-836E-AB4A-403A02F0B001' operation=u'getLocations' />]</Request>)
</Envelope>
AMF Response: <Envelope amfVersion=3>
 (u'/2', <Response status=/onResult><AcknowledgeMessage  body=[<Location: Thuis>, <Location: nog een locatie>] timestamp=1289567732 destination=None clientId='6a126b07-6a5f-4e34-97f6-a040a3763852' headers={} timeToLive=None messageId='88517394-bbb2-47c4-951a-e76beaec99e2' correlationId=u'9C757C92-191F-836E-AB4A-403A02F0B001' /></Response>)
</Envelope>

Any suggestions?

Cheers, Rob

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

Re: users Digest, Vol 36, Issue 6

Nick Joyce

On 12 Nov 2010, at 23:19, Minox Taurus wrote:

Hi Nick,


# Do I need the next line??
pyamf.register_class(Location, 'com.subscription.vos.LocationVO')

It depends. If you want the objects that are reassembled to be weakly typed then no, you don't need this. However if you want all Python Location instances to be built as specific classes in Flex/Flash, yes.

Okay, I understand.

All looks good so far.

After changing the 'com.subscription.vos.LocationVO' to 'com.meterstanden.vos.LocationVO' the scripts are at least working.
I can't however use amf3.use_proxies_default = True because Flash throws an error in:

private function onGetLocationsSuccess(event:ResultEvent):void

TypeError: Error #1034: Afgedwongen typeomzetting is mislukt: kan mx.utils::ObjectProxy@1b6ff7c1 niet omzetten in mx.messaging.messages.IMessage.

If I leave amf3.use_proxies_default = True out of the script the function works but I have to use this:

private function onGetLocationsSuccess(event:ResultEvent):void
{
_locationlist = new ArrayCollection( event.result as Array);
}

I've seen a ticket for this but I don't know if it is really fixed in PyAMF-0.6b2-py2.6?

PyAMF 0.6 has been released, I suggest upgrading to that to see if this fixes your problem.


These are the request and response using amf3.use_proxies_default

AMF Request: <Envelope amfVersion=3>
 (u'/1', <Request target=u'null'>[<CommandMessage  body={} timestamp=0 destination='' clientId=None headers={'DSMessagingVersion': 1, 'DSId': u'nil'} timeToLive=0 messageRefType=None messageId=u'7A74501B-844A-0721-F074-403A0313851F' operation=5 correlationId='' />]</Request>)
</Envelope>
AMF Response: <Envelope amfVersion=3>
 (u'/1', <Response status=/onResult><AcknowledgeMessage  body=True timestamp=1289567732 destination=None clientId='2e9da75a-ff58-4dd8-bfb3-72152e5ee1a9' headers={} timeToLive=None messageId='61ea065b-eeeb-4292-823b-b2fa6847f506' correlationId=u'7A74501B-844A-0721-F074-403A0313851F' /></Response>)
</Envelope>

These are the request and response without  using amf3.use_proxies_default 

AMF Request: <Envelope amfVersion=3>
 (u'/2', <Request target=u'null'>[<RemotingMessage  body=[] source=None timestamp=0 destination=u'meterstandenservice' clientId=None headers={'DSId': u'nil', 'DSEndpoint': u'pyamf'} timeToLive=0 messageId=u'9C757C92-191F-836E-AB4A-403A02F0B001' operation=u'getLocations' />]</Request>)
</Envelope>
AMF Response: <Envelope amfVersion=3>
 (u'/2', <Response status=/onResult><AcknowledgeMessage  body=[<Location: Thuis>, <Location: nog een locatie>] timestamp=1289567732 destination=None clientId='6a126b07-6a5f-4e34-97f6-a040a3763852' headers={} timeToLive=None messageId='88517394-bbb2-47c4-951a-e76beaec99e2' correlationId=u'9C757C92-191F-836E-AB4A-403A02F0B001' /></Response>)
</Envelope>

The two requests are not the same. The first is a ping from Flex to see if the remote service is available, the second is the RPC call as we would expect.

What would be most helpful for me to be able to reproduce (and therefore fix) your problem would be the raw http request/response payload from Flex/PyAMF. You can use an HTTP proxy (such as Charles) or Wireshark to capture the data, send to me offlist if you have sensitive information.

Cheers,

Nick

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