2010-06-22 66 views
3

昨天我花了半天的时间尝试强制Flex Remoting使用HTTPS而没有成功。Flex忽略services-config.xml中的更改

今天我试图连接到其他域。 我更改了端点的url,但它看起来像flex只是忽略了我的更改。 我相信,旧网址没有在src目录下的任何文件存在, 我甚至改名服务-config.xml中服务,config2.xml,清洗和rebuilded项目很多次,还送了一个发布版本,但它仍然连接到相同的域。

我在本地主机,在同一个域中,有AMF服务测试Flex应用程序,但它在相同的方式工作。

我的服务-config.xml的是:在MXML中

<?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的定义:

<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

编辑:我看了看生成/ 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(兼容模式)编译器来编译,但都有同样的问题:(

+0

这可能会或可能不会帮助(因为我们避免服务,配置,虽然我们可以做多,我们可以通过编程),但我知道几年前我遇到的问题与AMFChannel类和SecureAMFChannel类有关。我不确定在分析services-config xml文件时如何初始化remoteObject的channelSet,但我知道我感觉好像在编程完成这些事情时拥有更多的控制权。 – 2010-06-22 14:00:48

回答

1

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

+0

Allready尝试过。缓存完全被Firefox中的Web Developer插件禁用,每次都下载所有文件/ – Naktibalda 2010-06-22 11:34:26

+0

它突然开始工作,可能是因为我做了一个项目副本并更改了工作空间。 – Naktibalda 2010-06-22 12:07:28

+0

不能相信缓存问题再次袭击我!感谢提及 – 2012-12-03 16:32:00

1

你可以查阅一下被编译到Flex从* -config.XML文件有以下几点:

trace(ServerConfig.XML); 

此外,如果使用WTP和Tomcat,检查服务器使用Tomcat的实际安装,或者运行一个临时的eclipse文件夹。有时会导致混淆。

+0

大卫,谢谢你的提示。对原始文章有类似的麻烦 - 能够看到表面上已编译的内容是一件非常好的事情。 +1 – 2010-07-27 16:07:30

0

您必须在Flex Builder“清洁工程”当你改变services-config.xml中