昨天我花了半天的时间尝试强制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(兼容模式)编译器来编译,但都有同样的问题:(
这可能会或可能不会帮助(因为我们避免服务,配置,虽然我们可以做多,我们可以通过编程),但我知道几年前我遇到的问题与AMFChannel类和SecureAMFChannel类有关。我不确定在分析services-config xml文件时如何初始化remoteObject的channelSet,但我知道我感觉好像在编程完成这些事情时拥有更多的控制权。 – 2010-06-22 14:00:48