【发布时间】:2010-06-22 08:51:41
【问题描述】:
昨天我花了半天时间试图强制 Flex Remoting 使用 HTTPS,但没有成功。
今天我尝试连接到其他域。 我更改了端点的 url,但看起来 flex 只是忽略了我的更改。 我确信 src 目录中的任何文件中都不存在旧的 url, 我什至将 services-config.xml 重命名为 services-config2.xml,多次清理和重建项目,甚至进行了发布构建,但它仍然连接到同一个域。
我已经在 localhost 和同一域中测试了具有 AMF 服务的 flex 应用程序,但它的工作方式相同。
我的 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。
编辑:我查看了 generated/ 目录,发现 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,但我知道当这些事情以编程方式完成时,我感觉好像我有更多的控制权。
标签: apache-flex flex3