Flex 忽略 services-config.xml 中的更改 [英] Flex ignores changes in services-config.xml

查看:18
本文介绍了Flex 忽略 services-config.xml 中的更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天我花了半天时间试图强制 Flex Remoting 使用 HTTPS,但没有成功.

Yesterday I spent half of day trying to force Flex Remoting to use HTTPS with no success.

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

Today I tried to connect to other domain. I changed url of endpoint, but it looks like flex just ignores my changes. I am sure that an old url doesn't exist in any file in src directory, I even renamed services-config.xml to services-config2.xml, cleaned and rebuilded project many times, even made a release build, but it still connects to the same domain.

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

I have tested flex application in localhost and in the same domain, that has AMF services, but it works in the same way.

我的 services-config.xml 是:

My services-config.xml is:

<?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 definition in mxml:

<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.

I'm using Flex 3.

我查看了generated/dir,我看到FlexInit文件(如MainModule_FlexInit-generated.as)包含代码:

I took a look at generated/ dir and I see that FlexInit files (like MainModule_FlexInit-generated.as) contains code:

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 发出请求

That's correct, but application doesn't make requests to gintautas.dev.company.com

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

Edit 2: I installed Flash Builder 4 and tried to compile using 3.5 and 4.0(in compatibility mode) compilers, but both has the same problem :(

推荐答案

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

you can check what is being compiled into flex from the *-config.XML files with the following:

trace( ServerConfig.XML );

此外,如果将 WTP 与 tomcat 一起使用,请检查服务器是否正在使用 tomcat 的实际安装,或要运行的临时 eclipse 文件夹.这有时会导致混淆.

Also, if using WTP with tomcat, check if server is using the actual installation of tomcat, or a temp eclipse folder to run. that can sometimes cause mix ups.

这篇关于Flex 忽略 services-config.xml 中的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆