利用导入的 Web 服务部署 Flex 项目

发布于 2024-07-09 10:06:24 字数 527 浏览 6 评论 0原文

我确信对此有一个简单的解释,但我还没有找到答案,所以我想我应该把这个消息告诉我的同事,因为我确信你们中的一些人已经跑过之前进入过这个。

在我的(简单)开发环境中,我正在使用一些 WCF Web 服务,将其导入到我的 FB3 项目中并针对 ASP.NET 开发 Web 服务器的本地实例。 一切都很好,没有问题——但我现在想知道的是,将该项目部署到测试、登台和生产环境的正确方法是什么? 如果我导入的代理全部指向 http://localhost:1234/service.svc ( WSDL 是从中导入的),而我部署的只是一个已编译的 SWF,Flex Builder 是否希望我在每次想要移动我的应用程序时“管理 Web 服务 > 删除”、“> 添加”、重新编译和发布编译Flex项目从开发到测试,再到登台,最终投入生产? 有没有更简单的工作流程?

提前致谢——希望我的问题很清楚。

干杯, 克里斯

I'm sure there's a simple explanation for this, but I haven't had much luck at finding the answer yet, so I figured I'd put the word out to my colleagues, as I'm sure some of you've run into this one before.

In my (simple) dev environment, I'm working with a handful of WCF Web Services, imported into my FB3 project and targeting a local instance of the ASP.NET development Web server. All good, no problems -- but what I'd like to know now is, What's the right way to deploy this project to test, staging and production environments? If my imported proxies all point, say, to http://localhost:1234/service.svc (from which their WSDLs were imported), and all I'm deploying is a compiled SWF, does Flex Builder expect me to "Manage Web Services > Delete", "> Add", recompile and release ever time I want to move my compiled Flex project from development to test, and to staging, and ultimately into production? Is there a simpler workflow for this?

Thanks in advance -- hope my question was clear.

Cheers,
Chris

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

烟─花易冷 2024-07-16 10:06:24

如果您的路径名会根据环境而变化,那么您可能需要为每个环境重新编译,因为这些将在 swf 中进行编译。

从开发和生产环境迁移时,我通常使用 ANT 脚本来处理编译/部署过程。 这使我能够在编译期间动态更改任何路径名。 这些构建文件可以集成到 Flex Builder 中,一旦您完成所有设置,此过程就变得非常简单,并且可以通过单击或按计划完成。

If you have path names which will change depending on the enviroment then you will likely need to recompile for each environment since these will be compiled in the swf.

I typically use ANT scripts to handle my compile/deployment process when moving from development and production environments. This gives me the ability to dynamically change any path names during the compile. These build files can be integrated into Flex Builder making this process very easy once you have everything set up, and can be done with one click or scheduled.

半透明的墙 2024-07-16 10:06:24

谢谢布雷特。 无论如何,我一直想深入研究自动化构建过程,所以现在可能是最好的时机。 :)

Thanks Brett. I've been meaning to dig into automating my build processes anyway, so now's probably as good a time as any. :)

生死何惧 2024-07-16 10:06:24

您不需要为每个环境构建一个 SWF。 以下是我常用的一种技术:

  1. 将配置属性外部化到 XML 文件中; 在这种情况下,它可以是每个服务的 URL 或所有服务使用的基本 URL
  2. 当应用程序启动时,进行 HTTPService 调用来加载 XML 文件,解析它,并将属性存储到某个可绑定的“配置对象”上"
  3. 将该对象中的值与依赖于 URL 的对象
  4. 绑定 调度一个事件,指示您的配置已完成。 如果您的应用程序中的某些组件使用某种单例事件调度程序,请使用它,以便通知是全局的
  5. 现在继续进行应用程序的其余初始化

需要一些工作来编排您的应用程序,以便某些部分在执行步骤 1-5 之前不会初始化。 不过,我认为显式处理大量初始化而不是在组件的构造函数或各种初始化或创建完成事件中是一种很好的做法。 当用户注销并且其他用户登录时,您可能需要重新初始化; 如果您已经将应用程序设置为可以控制初始化,那么重新初始化将不是问题。

You do not need to build a SWF for each environment. Here's a technique I use commonly:

  1. Externalize your configuration properties into an XML file; in this case, it could be a URL for each service or a base URL used by all your services
  2. When the application starts up, make an HTTPService call to load the XML file, parse it, and store your properties onto some bindable "configuration object"
  3. Bind the values from that object against your objects that depend on the URLs
  4. Dispatch an event that indicates your configuration is complete. If you have some kind of singleton event dispatcher used by some components in your app, use that, so that the notification is global
  5. Now proceed with the rest of the initialization of your application

It takes a little work to orchestrate your app such that certain parts won't initialize until steps 1-5 take place. However I think it's good practice to handle a lot of this initialization explicitly rather than in constructors or various initialize or creationComplete events for components. You may need to reinitialize things when a user logs out and a different user logs in; if you already have your app set up to that initialization is something you can control then reinitialization will not be a problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文