Deploy Flex Projects Using Imported Web Services

I'm sure there is a simple explanation for this, but I haven't been able to find an answer yet, so I thought I'd pass the word on to my colleagues as I'm sure some of you have encountered this before.

In my (simple) dev environment, I am working with multiple WCF web services imported into my FB3 project and targeting a local ASP.NET development web server instance. All good, no problem - but what I would like to know now is the correct way to deploy this project for testing, staging and production environments? If my imported proxies all point to, say, http: // localhost: 1234 / service.svc(from which their WSDL was imported) and all I am deploying is compiled SWF, does Flex Builder do Web Services Management> Uninstall, Add, recompile and release all the time. Do I want to move my compiled Flex project from development to test as well as stage and eventually production? Is there an easier workflow for this?

Thanks in advance - hope my question was clear.

Cheers, Chris

0


source to share


3 answers


If you have path names that will change depending on your environment, you will probably need to recompile for each environment as they will be compiled to swf.



I usually use ANT scripts to handle my compilation / deployment process when moving from dev and production environments. This gives me the ability to dynamically change any path names at compile time. These build files can be integrated into Flex Builder, making the process very easy, once you have all the settings configured, with one click or on a schedule.

0


source


Thanks Brett. What I meant was that I needed to automate my build processes anyway, so now maybe as good as everyone else. :)



0


source


You don't need to create SWF for every environment. Here is the technique I usually use:

  • Extract the configuration properties to an XML file; in this case, it can be the URL for each service, or the base URL used by all of your services.
  • When the application starts, call the HTTPService call to load the XML file, parse it, and store your properties on some bridging "config object"
  • Bind the values โ€‹โ€‹of this object to objects that depend on urls
  • Dispatch an event that indicates that your configuration is complete. If you have some sort of singleton event dispatcher used by some of the components in your application, use that to make the notification global.
  • Now let's move on to the rest of the initialization of your application.

It takes a little work to organize your application so that certain parts are not initialized until after steps 1-5 are completed. However, I think it's good practice to handle most of this initialization explicitly, rather than in constructors or various initialization orComplete events for components. You may have to re-initialize things when a user logs out and another user logs in; if you already have an app configured to do this initialization you can manage and re-initialization won't be a problem.

0


source







All Articles