I also prefer to configure services
(ChannelSets/Channels/RemoteObjects etc...) at runtime. Typically I do
this by reading in the configuration property values from an XML file
when the application loads. There are a couple of IoC/DI (Inversion of
Control/Dependency Injection) container implementations (SWIZ and
Spring-AS to name a couple) that also make this very easy. However,
you don't need to be that sophisticated; simply getting the property
values from an xml file will accomplish your goal and remove your
dependency to the services-config.xml so can avoid baking in those
settings at compile time. 


--- In flexcoders@yahoogroups.com, "Gregor Kiddie" <gkid...@...> wrote:
>
> We construct our Remote Objects at runtime. You can use something like
> 
> servletPath = URLUtil.parseUriPath( Application.application.url ) +
> "messagebroker/amf";
> 
>  
> 
> to generate the URL you should be hitting (our URLUtil class strips the
> URL back to the context root, YMMV).
> 
>  
> 
> That way you can generate a single swf, and it adapts to the environment
> is deployed into.
> 
>  
> 
> Gk.
> 
> Gregor Kiddie
> Senior Developer
> INPS
> 
> Tel:       01382 564343
> 
> Registered address: The Bread Factory, 1a Broughton Street, London SW8
> 3QJ
> 
> Registered Number: 1788577
> 
> Registered in the UK
> 
> Visit our Internet Web site at www.inps.co.uk
> <blocked::http://www.inps.co.uk/> 
> 
> The information in this internet email is confidential and is intended
> solely for the addressee. Access, copying or re-use of information in it
> by anyone else is not authorised. Any views or opinions presented are
> solely those of the author and do not necessarily represent those of
> INPS or any of its affiliates. If you are not the intended recipient
> please contact is.helpd...@...
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
> Behalf Of tchredeemed
> Sent: 17 February 2009 19:32
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] problem with services-config.xml in multiple work
> environments..
> 
>  
> 
> Basically..
> 
> We develop on localhost:3000, we test on http://dev.oursite.com,
> <http://dev.oursite.com,>  and
> we go live on https://www.oursite.com. <https://www.oursite.com.> 
> 
> I need 3 different environments, one for each environment.
> 
> Right now I have to recompile the SWF everytime I want to create it
> for a new environment.
> 
> Obviously, when we have multiple people using it on localhost, I have
> to create these swf's too often.
> 
> I was hoping there is a way that I can set up services-config.xml to
> point to the right url...
> 
> I would almost like to set up a daisy chain or something, it tries
> www, if it can't get that, it tries dev, if it cant get that, it tries
> localhost.
> 
> Any help would really be greatly appreciated...
>


Reply via email to