某些 IE 版本中未提出氟请求
我们构建的氟集成件遇到了一个非常奇怪的问题。
我们有一个带有验证码的表格; Captcha 图像是从名为 GetCaptchaImage.ashx
的 .Net/AMF Web 服务填充的,并且可以从 Flash 中的文本超链接重新加载。
在某些版本的 IE(特别是 IE8,但也可能是其他版本)中,无论 IE版本模拟和wmode,点击文本链接会导致对 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 继承的,没有任何覆盖,所以我不明白为什么它不只是 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
在 CaptchaSignal
extends org.osflash.signals.Signal
中定义
public class CompetitionFormMediator extends AbstractFactoryAccessorMediator
{
[Inject]
public var captchaSignal:CaptchaSignal;
// ...
}
,并不有趣,但在一行中调用:
signalCommandMap.mapSignalClass(CaptchaSignal, CaptchaCommand);
CaptchaCommand< /code> 扩展了
SignalCommand
并最终在 flash.events.EventDispatcher
中调用
var callFunction:Function = serviceHub.call;
callFunction.apply(serviceHub, collectArgs);
,其中 collectArgs
是一个 Array
没有提供任何线索的论点。
结束编辑
有谁知道为什么第二个调用不会到达网络服务器吗?我不明白为什么 Flash 不会发出 HTTP GET
但同样,我想不出浏览器(更不用说这个浏览器)会抑制它的任何原因。我不是 Flash 开发人员(我在这里管理 .Net 团队),但我看不出有什么奇怪的地方,而且我和 Flash 团队(包括构建代码的开发人员)都无法想到这可能的任何原因正在发生。
有人有什么想法吗?
We have a really strange problem with a piece of Fluorine integration we've built.
We have a form with a Captcha on it; the Captcha image is populated from a .Net/AMF webservice inventively titled GetCaptchaImage.ashx
and can be reloaded from a text hyperlink within the Flash.
In some versions of IE (particularly IE8, but it may also be others), irrespective of IE version emulation and wmode, clicking the text link causes the HTTP call to our Fluorine gateway successfully to be made, but the call to the webservice does not follow it. Inspecting the HTTP transactions with Microsoft Fiddler, we see:
POST http://www.domain.com/gateway.aspx
200 OK (application/x-amf)
and nothing else, whereas in any other browser we see:
POST http://www.domain.com/gateway.aspx
200 OK (application/x-amf)
GET http://www.domain.com/GetCaptchaImage.ashx
200 OK (image/gif)
The code that makes the call appears to be inherited, without any override, from org.osflash.signals.Signal.dispatch
, so I can't see why it wouldn't Just Bloody Work™. The actual method call reads:
private function getNewCaptcha(event:MouseEvent):void
{
getCaptchaAgain.dispatch();
trace("Captcha button click");
GlobalDebugger.log(this, "Captcha button click!");
}
where the only other mentions of getCaptchaAgain
in the entire codebase are:
public var getCaptchaAgain:Signal = new Signal();
and
compForm.getCaptchaAgain.add(getTheCaptchaAgain);
and the only other occurrence of getNewCaptcha
is the line:
_cantReadCaptchaButton.addEventListener(MouseEvent.CLICK, getNewCaptcha);
Edit: Juan Pablo Califano pointed out I'd failed to notice that there was a reference to getTheCaptchaAgain
, which I'd misread as getCaptchaAgain
. It is defined as
private function getTheCaptchaAgain():void
{
captchaSignal.dispatch();
}
and is only called from onFormResponse
, where it is uninteresting. captchaSignal
is defined in
public class CompetitionFormMediator extends AbstractFactoryAccessorMediator
{
[Inject]
public var captchaSignal:CaptchaSignal;
// ...
}
CaptchaSignal
extends org.osflash.signals.Signal
and is uninteresting but is called in a line reading:
signalCommandMap.mapSignalClass(CaptchaSignal, CaptchaCommand);
CaptchaCommand
extends SignalCommand
and ends up inside flash.events.EventDispatcher
calling
var callFunction:Function = serviceHub.call;
callFunction.apply(serviceHub, collectArgs);
where collectArgs
is an Array
of arguments that don't offer any clues.
End edit
Does anyone have any idea why on earth that second call wouldn't be making it to the webserver? I can't see why the Flash wouldn't be issuing the HTTP GET
but, equally, I can't think of any reason why a browser (let alone just this browser) would be suppressing it. I'm not a Flash developer (I run the .Net team here), but I can't see anything odd there and neither I nor the Flash team (including the developer who built the code) can think of any reason why this might be happening.
Any ideas anyone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
毕竟,看起来这是 Flash 中其他地方的问题,并且浏览器认为有问题的处理程序 (
/GetCaptchaImage.ashx
) 没有变化。因此,我们通过缓存设置解决了问题,而不需要做太多其他事情。
感谢大家的帮助,特别是 Juan Pablo!
After all that, it looks like it was a problem elsewhere in the Flash, and the handler in question (
/GetCaptchaImage.ashx
) being considered unchanged by the browser.So we've solved the problem with caching settings, rather than needing to do much else.
Thanks for your help everyone, particularly Juan Pablo!