RemoteObject dynamic destination?

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

RemoteObject dynamic destination?

maunger
I'm trying to save myself a few minutes and my brain... may be a waste of effort but I'm
hoping someone can help.

My local test environment is not SSL - our dev and production environments are. We have
the services-config and remote configs set up properly no problem... everything works.
Except, when testing locally, we put

<mx:RemoteObject id="RemoteUserService" destination="ColdFusion"
showBusyCursor="true" source="mbfnetperf.remote.RemoteUserService">

and when pushing out to dev/production, we have to change to:
<mx:RemoteObject id="RemoteUserService" destination="SecureColdFusion"
showBusyCursor="true" source="mbfnetperf.remote.RemoteUserService">

so i thought i could simply do:
destination="{servicesDestination}"

debug shows a valid value of "ColdFusion" in the variable "servicesDestination" but the call
fails
[MessagingError message=''null' is not a valid destination.']

I don't want to recode all of the MXML calls to AS (it probably wouldn't take forever) but i
was just wondering if there's a simple answer instead of rewriting

Thanks for any ideas - haven't found a solution in the archives

Reply | Threaded
Open this post in threaded view
|

RE: RemoteObject dynamic destination?

Seth Hodgson
When you run into an issue with MXML bindings your best bet to troubleshoot is to set the keep-generated flag for the compiler to true. When you assign to the 'destination' property using a binding, after compiling we see the following code in the {MainApp}-generated.as for that RemoteObject instance:

var temp : mx.rpc.remoting.mxml.RemoteObject = new mx.rpc.remoting.mxml.RemoteObject();
remoteObject = temp;
temp.destination = null;
...

The generated assignment of null to the 'destination' property is triggering the RTE, and this runs before the binding to your 'servicesDestination' var is evaluated. So, for now you'll need to avoid using a binding to assign this property and just do it in code directly from your app's creationComplete handler or something.

I've logged an enhancement request for this: https://bugs.adobe.com/jira/browse/SDK-19102

Best,
Seth

From: [hidden email] [mailto:[hidden email]] On Behalf Of maunger
Sent: Tuesday, February 03, 2009 10:29 AM
To: [hidden email]
Subject: [flexcoders] RemoteObject dynamic destination?

I'm trying to save myself a few minutes and my brain... may be a waste of effort but I'm
hoping someone can help.

My local test environment is not SSL - our dev and production environments are. We have
the services-config and remote configs set up properly no problem... everything works.
Except, when testing locally, we put

<mx:RemoteObject id="RemoteUserService" destination="ColdFusion"
showBusyCursor="true" source="mbfnetperf.remote.RemoteUserService">

and when pushing out to dev/production, we have to change to:
<mx:RemoteObject id="RemoteUserService" destination="SecureColdFusion"
showBusyCursor="true" source="mbfnetperf.remote.RemoteUserService">

so i thought i could simply do:
destination="{servicesDestination}"

debug shows a valid value of "ColdFusion" in the variable "servicesDestination" but the call
fails
[MessagingError message=''null' is not a valid destination.']

I don't want to recode all of the MXML calls to AS (it probably wouldn't take forever) but i
was just wondering if there's a simple answer instead of rewriting

Thanks for any ideas - haven't found a solution in the archives