论坛首页 Java企业应用论坛

blazeds配置时的关键点(基础)

浏览 3133 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2009-11-13   最后修改:2009-11-13

刚刚开始 flex 开发,做 blaze 配置时发现网上的资料都遗漏了很多关键信息。以下内容仅为补充,具体的配置可以参考:

http://yexin218.iteye.com/blog/199933

http://lym6520.iteye.com/blog/390347

 

 

前提: flex java 应用分别位于两个工程

针对的问题: flex 与后台通信通道的建立

 

关键点 1

必须在 flex 工程的 Flex Compiler 中增加参数: -services=C:\work\workspace1\workspace_flex\services-config.xml

该配置用于 flex 编译 swf 文件时自动创建通道。

 

 

关键点 2

Flex 工程中配置的 services-config.xml 文件中的 {server.name}:{server.port}/{context.root}   必须指向实际的 web 应用地址,这样 swf 文件中的通道才能与 web 应用进行连接。

 

例如:

    <channels>

        <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://localhost:8400/demo/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>

        <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
            <endpoint url="https://localhost:8400/demo/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
            <properties>
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </channel-definition>

        <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://localhost:8400/demo/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>true</polling-enabled>
                <polling-interval-seconds>4</polling-interval-seconds>
            </properties>
        </channel-definition>

        <!--
        <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
            <endpoint url="http://localhost:8400/demo/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
        </channel-definition>

        <channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
            <endpoint url="https://localhost:8400/demo/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
            <properties>
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </channel-definition>
        -->
    </channels>
 

 

关键点 3

services-config.xml 文件所在目录下必须同时存在以下 4 个文件:

messaging-config.xml

proxy-config.xml

remoting-config.xml

services-config.xml

 

关键点 4

web 端的 services-config.xml 中的 {server.name}:{server.port}/{context.root} 是可以不用变更的,可以保留原状。

 

 

  • 大小: 40.6 KB
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics