在services-config.xml中简化Flex部署?

时间:2010-01-26 01:38:18

标签: flex flash remoting heroku weborb

我正在使用Flex / Flash构建一个前端我的Rails服务器应用程序的UI。我使用WebORB作为通信机制。然而,我的问题应该仅适用于WebORB。 (我想)。

具体来说,它与services-config.xml文件有关。我有一个本地(笔记本电脑)开发环境,一个远程开发人员和一个远程生产环境。我厌倦了在services-config.xml文件中编辑URL,每次我想在不同的环境中测试时重建和部署。

有没有人对如何做到这一点有任何想法?我以为我可以做到以下几点:

   <channel-definition id="supremacy" class="mx.messaging.channels.AMFChannel">
        <endpoint uri="/weborb" class="flex.messaging.endpoints.AMFEndpoint"/>
        <properties>
            <polling-enabled>true</polling-enabled>
        </properties>
    </channel-definition>

通过设置URI =“/ weborb”并给它一个相对路径,我认为它会起作用。它确实 - 本地 - 但是当我将它部署到我的远程开发和生产环境(Heroku)时它不会。怪异。

2 个答案:

答案 0 :(得分:1)

您可以通过使用Ant构建项目来简化过程。例如,您可以为每个环境创建单独的services-config.xml文件,然后为不同的环境编译单独的构建脚本,自动选择适当的配置文件。

答案 1 :(得分:1)

您可以在应用程序启动时配置服务(因此基于配置文件)

使用amfEndpoint作为字符串

创建一个频道
  

var channelSet:ChannelSet = new ChannelSet();

     

var channel:NetConnectionChannel = null;

     

channel = new AMFChannel(“my-amf”,amfEndpoint);

     

channelSet.addChannel(频道);

将它提供给您的远程对象

  

ServiceLocator.getInstance()。getRemoteObject(“myService”)。channelnel = channelSet;

相关问题