Flex忽略services-config.xml中的更改

时间:2010-06-22 08:51:41

标签: flex flex3

昨天我花了一半时间试图强迫Flex Remoting使用HTTPS但没有成功。

今天我尝试连接到其他域名。 我更改了端点的url,但看起来flex只是忽略了我的更改。 我确信src目录中的任何文件中都不存在旧的url, 我甚至将services-config.xml重命名为services-config2.xml,多次清理和重建项目,甚至进行了发布构建,但它仍然连接到同一个域。

我已在localhost和同一域中测试了flex应用程序,它具有AMF服务,但它的工作方式相同。

我的services-config.xml是:

<?xml version="1.0" encoding="UTF-8"?>
<services-config>
    <services>
        <service id="amfphp-flashremoting-service" class="flex.messaging.services.RemotingService" messageTypes="flex.messaging.messages.RemotingMessage">
            <destination id="amfphp">
                <channels>
                    <channel ref="my-amfphp-secure"/>
                    <channel ref="my-amfphp"/>
                </channels>
                <properties>
                    <source>*</source>
                </properties>
            </destination>
        </service>
    </services>
    <channels>
        <channel-definition id="my-amfphp-secure" class="mx.messaging.channels.SecureAMFChannel">
            <endpoint uri="https://xxx.dev.company.com:443/AMF" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
            <properties>
                <polling-enabled>false</polling-enabled>
                <serialization>
                    <instantiate-types>false</instantiate-types>
                    <log-property-errors>true</log-property-errors>
                </serialization>
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </channel-definition>
        <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel" >
            <endpoint uri="http://xxx.dev.company.com/AMF" class="flex.messaging.endpoints.AMFEndpoint" />
            <properties>
                <polling-enabled>false</polling-enabled>
                <serialization>
                    <instantiate-types>false</instantiate-types>
                    <log-property-errors>true</log-property-errors>
                </serialization>
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </channel-definition>
    </channels>
</services-config>

mxml中的RemoteObject定义:

<mx:RemoteObject id="Agentrpc" destination="amfphp" source="Agentrpc" showBusyCursor="true">
    <mx:method name="getAgentID" result="getAgentID_resultHandler(event)" fault="faultHandler(event)"/>
</mx:RemoteObject>

我正在使用Flex 3。

编辑:我看了一下generate / dir,我发现FlexInit文件(如MainModule_FlexInit-generated.as)包含代码:

ServerConfig.xml =
<services>
    <service id="amfphp-flashremoting-service">
        <destination id="amfphp">
            <channels>
                <channel ref="my-amfphp-secure"/>
                <channel ref="my-amfphp"/>
            </channels>
        </destination>
    </service>
    <channels>
        <channel id="my-amfphp-secure" type="mx.messaging.channels.SecureAMFChannel">
            <endpoint uri="https://gintautas.dev.company.com:443/AMF"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel>
        <channel id="my-amfphp" type="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://gintautas.dev.company.com/AMF"/>
            <properties>
                <polling-enabled>false</polling-enabled>
            </properties>
        </channel>
    </channels>
</services>;

这是正确的,但应用程序不向gintautas.dev.company.com提出请求

编辑2:我安装了Flash Builder 4并尝试使用3.5和4.0(在兼容模式下)编译器进行编译,但两者都存在同样的问题:(

3 个答案:

答案 0 :(得分:1)

您可以尝试清除浏览器缓存吗? services.xml的内容在编译时注入SWF。

答案 1 :(得分:1)

您可以使用以下命令检查* -config.XML文件中编译为flex的内容:

trace( ServerConfig.XML );

此外,如果将WTP与tomcat一起使用,请检查服务器是否正在使用tomcat的实际安装,或者运行temp eclipse文件夹。这有时会引起混乱。

答案 2 :(得分:0)

更改services-config.xml

时,必须在Flex Builder中“清理项目”