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

问题描述

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



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

我测试了flex应用程序在本地主机和在同一个域,有AMF服务,但它的工作原理



我的services-config.xml是:

$ p $ <?xml version =1.0encoding =UTF-8?>
< services-config>
< services>
< service id =amfphp-flashremoting-serviceclass =flex.messaging.services.RemotingServicemessageTypes =flex.messaging.messages.RemotingMessage>
< destination id =amfphp>
<渠道>
< channel ref =my-amfphp-secure/>
< channel ref =my-amfphp/>
< / channels>
<属性>
< source> *< / source>
< / properties>
< / destination>
< / service>
< / services>
<渠道>
< channel-definition id =my-amfphp-secureclass =mx.messaging.channels.SecureAMFChannel>
< endpoint uri =https://xxx.dev.company.com:443/AMFclass =flex.messaging.endpoints.SecureAMFEndpoint/>
<属性>
< polling-enabled> false< / polling-enabled>
< serialization>
<实例化类型>假< /实例化类型>
< log-property-errors> true< / log-property-errors>
< / serialization>
< add-no-cache-headers> false< / add-no-cache-headers>
< / properties>
< / channel-definition>
< channel-definition id =my-amfphpclass =mx.messaging.channels.AMFChannel>
< endpoint uri =http://xxx.dev.company.com/AMFclass =flex.messaging.endpoints.AMFEndpoint/>
<属性>
< polling-enabled> false< / polling-enabled>
< serialization>
<实例化类型>假< /实例化类型>
< 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 =Agentrpcdestination =amfphpsource =AgentrpcshowBusyCursor =true> 
< mx:method name =getAgentIDresult =getAgentID_resultHandler(event)fault =faultHandler(event)/>
< / mx:RemoteObject>

我正在使用Flex 3.

编辑:我看看生成的/目录,我看到FlexInit文件(如MainModule_FlexInit-generated.as)包含代码:

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

这是正确的,但应用程序不会向gintautas.dev.company.com发送请求。 >

编辑2:我安装了Flash Builder 4并尝试使用3.5和4.0(在兼容模式下)编译器进行编译,但两者都有相同的问题:($ / b $您可以使用以下命令检查* -config.XML文件中正在编译为flex的内容:
$ b $
b

  trace(ServerConfig.XML); 

另外,如果在tomcat上使用WTP,检查服务器是否正在使用tomcat的实际安装,或者是一个临时的eclipse文件夹来运行,有时会导致混乱。


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

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.

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

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>

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>

I'm using Flex 3.

Edit: 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>;

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

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 :(

解决方案

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

trace( ServerConfig.XML );

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中的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 20:36