【问题标题】:Fluorine request not being made in some IE versions在某些 IE 版本中没有提出氟请求
【发布时间】:2011-04-18 19:59:57
【问题描述】:

我们构建的 Fluorine 集成存在一个非常奇怪的问题。

我们有一个带有验证码的表单; Captcha 图像由创造性地命名为 GetCaptchaImage.ashx 的 .Net/AMF 网络服务填充,并且可以从 Flash 中的文本超链接重新加载。

在某些版本的 IE(尤其是 IE8,但也可能是其他版本)中,无论IE version emulationwmode,单击文本链接都会导致对我们的 Fluorine 网关的 HTTP 调用成功要进行,但对 web 服务的调用并没有跟随它。使用Microsoft Fiddler 检查 HTTP 事务,我们看到:

POST http://www.domain.com/gateway.aspx
200 OK (application/x-amf)

仅此而已,而在我们看到的任何其他浏览器中:

POST http://www.domain.com/gateway.aspx
200 OK (application/x-amf)
GET http://www.domain.com/GetCaptchaImage.ashx
200 OK (image/gif)

进行调用的代码似乎是从org.osflash.signals.Signal.dispatch 继承的,没有任何覆盖,所以我不明白为什么它不会 Just Bloody Work™。实际的方法调用如下:

private function getNewCaptcha(event:MouseEvent):void
{
    getCaptchaAgain.dispatch();
    trace("Captcha button click");
    GlobalDebugger.log(this, "Captcha button click!");
}

在整个代码库中唯一提到 getCaptchaAgain 的地方是:

public var getCaptchaAgain:Signal = new Signal();

compForm.getCaptchaAgain.add(getTheCaptchaAgain);

getNewCaptcha 唯一出现的其他地方是以下行:

_cantReadCaptchaButton.addEventListener(MouseEvent.CLICK, getNewCaptcha);

编辑:Juan Pablo Califano 指出我没有注意到对getTheCaptchaAgain 的引用,我会误读为getCaptchaAgain。它被定义为

private function getTheCaptchaAgain():void
{
    captchaSignal.dispatch();
}

并且仅从onFormResponse 调用,这很无趣。 captchaSignal 定义在

public class CompetitionFormMediator extends AbstractFactoryAccessorMediator
{
    [Inject]
    public var captchaSignal:CaptchaSignal;
    // ...
}

CaptchaSignal 扩展了org.osflash.signals.Signal 并且无趣,但在一行中被调用:

signalCommandMap.mapSignalClass(CaptchaSignal, CaptchaCommand);

CaptchaCommand 扩展 SignalCommand 并最终在 flash.events.EventDispatcher 调用

var callFunction:Function = serviceHub.call;
callFunction.apply(serviceHub, collectArgs);

其中collectArgsArray 的参数,不提供任何线索。

结束编辑

有谁知道为什么第二次调用不会发送到网络服务器?我不明白为什么 Flash 不会发出 HTTP GET,但同样,我想不出浏览器(更不用说这个浏览器)会抑制它的任何原因。我不是 Flash 开发人员(我在这里管理 .Net 团队),但我看不出有什么奇怪的地方,而且我和 Flash 团队(包括构建代码的开发人员)都想不出任何可能的原因正在发生。

有什么想法吗?

【问题讨论】:

  • getTheCaptchaAgain 方法是否被调用?该方法的代码是什么? (我对 Signals 没有太多经验,但我知道它是一个事件调度框架,因此发出实际 http 请求的代码必须在 getTheCaptchaAgain 或从那里调用的其他函数上)。
  • getCaptchaAgain 是用户点击重新加载验证码的表单上的按钮;我相信功能本身是由 Fluorine 框架处理的,但是对网关的初始 HTTP 调用被调用,我们只是不明白为什么特定的 web 服务随后没有被调用。
  • 在我看来,getCaptchaAgain 是一个调度程序,getTheCaptchaAgain 是一个注册到它的侦听器(根据这一行:compForm.getCaptchaAgain.add(getTheCaptchaAgain);。所以,流程似乎是:_cantReadCaptchaButton被点击,鼠标事件被getNewCaptcha捕获;getCaptchaAgain.dispatch()被调用,导致getCaptchaAgain通知它的监听器,大概是getTheCaptchaAgain。这就是为什么我提到getTheCaptchaAgain方法(不是getCaptchaAgain对象). 同样,我不熟悉 Floruine 或 Signals,所以我可能是错的。
  • 我没有注意到 getCaptchaAgaingetTheCaptchaAgain 是两个不同的东西(我将与 ActionScript 人员讨论命名约定;o)我已经编辑了问题以提供更多上下文。
  • 你在服务器上启用 log4Net 了吗?您可以将 FluorineFx 的操作记录到 txt 文件或数据库中。这也许可以帮助您了解为什么有时根本不调用 GetCaptchaImage.ashx。

标签: actionscript-3 internet-explorer-8 amf fluorinefx


【解决方案1】:

毕竟,这似乎是 Flash 中其他地方的问题,并且浏览器认为有问题的处理程序 (/GetCaptchaImage.ashx) 未更改。

所以我们已经解决了缓存设置的问题,而不需要做很多其他事情。

感谢大家的帮助,尤其是Juan Pablo

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-09-23
    • 2017-04-02
    • 1970-01-01
    • 2020-06-09
    • 1970-01-01
    • 1970-01-01
    • 2021-07-13
    相关资源
    最近更新 更多