Adobe Flex 4.6 WebService 请求超时 [英] Adobe Flex 4.6 WebService request timeout

查看:29
本文介绍了Adobe Flex 4.6 WebService 请求超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

连接到我的 WebService(Lotus Notes 数据库)的代码是由 Flash Builder 通过Data/Connect with WebService..."创建的.一切正常,但我有一个问题来增加请求超时.API 说您可以像这样设置请求超时:

_serviceControl.requestTimeout = 300;

在 iOS (iPad) 上似乎一切正常.但是,如果我在桌面或 Android 智能手机上运行我的应用程序,这仅在我将请求超时设置为低于约 30 秒时才有效.如果我没有设置请求超时或超过 30 并且我的应用程序需要超过 30 秒来等待答案/结果,_serviceControl"会触发带有消息的 FaultEvent:

body = ""clientId = "DirectHTTPChannel0"相关ID =CDED773E-34E5-56F8-D521-4FFC393D7565"目的地 = ""扩展数据 =(空)faultCode = "Server.Error.Request"faultDetail = "错误:[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="错误 #2032:流错误.URL:http://...?OpenWebService"errorID=2032].URL: "http://...?OpenWebService"faultString = "HTTP 请求错误"标题=(对象)#1DSStatusCode = 0messageId = "91D11378-49D4-EDF7-CE7A-4FFCB09EBC47"rootCause = (flash.events::IOErrorEvent)#2气泡 = 假可取消 = 假currentTarget = (flash.net::URLLoader)#3字节加载 = 0字节总数 = 0数据 = ""数据格式=文本"错误 ID = 2032事件阶段 = 2目标 = (flash.net::URLLoader)#3text = "Error #2032: Stream Error. URL: "http://...?OpenWebService"类型 = "ioError"时间戳 = 0生存时间 = 0

知道为什么会这样吗?

解决方案

我遇到了同样的问题,requestTimeout 不起作用.

如果有人在寻找答案,这个配置对我来说很好用:

import flash.net.URLRequestDefaults;URLRequestDefaults.idleTimeout = 120000;//注意这个值代表毫秒(120秒)

查看此处了解更多详细信息:Flex HTTPService 无论如何都会超时

The code to get connected to my WebService (Lotus Notes Database) is created by the Flash Builder over "Data/Connect with WebService...". All works fine, but I have a problem to increase the request timeout. The API says that you can set the request timeout like this:

_serviceControl.requestTimeout = 300;

On a iOS (iPad) it seems to be work all fine. But if I run my app on desktop or on an android smartphone this only works if I set up the request timeout lower than ~30 seconds. If I don't set up the request timeout or higher than 30 and my app needs longer than 30 seconds to wait for an answer/result the "_serviceControl" fires an FaultEvent with the message:

body = ""  
clientId = "DirectHTTPChannel0"  
correlationId = "CDED773E-34E5-56F8-D521-4FFC393D7565"  
destination = ""  
extendedData = (null)  
faultCode = "Server.Error.Request"  
faultDetail = "Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: "http://...?OpenWebService" errorID=2032]. URL: "http://...?OpenWebService"  
faultString = "HTTP request error"  
headers = (Object)#1  
DSStatusCode = 0  
messageId = "91D11378-49D4-EDF7-CE7A-4FFCB09EBC47"  
rootCause = (flash.events::IOErrorEvent)#2  
bubbles = false  
cancelable = false  
currentTarget = (flash.net::URLLoader)#3  
bytesLoaded = 0  
bytesTotal = 0  
data = ""  
dataFormat = "text"  
errorID = 2032  
eventPhase = 2  
target = (flash.net::URLLoader)#3  
text = "Error #2032: Stream Error. URL: "http://...?OpenWebService"  
type = "ioError"  
timestamp = 0  
timeToLive = 0

Any idea why this happens?

解决方案

I had the same problem, requestTimeout didn't work.

If someone is looking for an answer, this configuration works fine for me :

import flash.net.URLRequestDefaults;

URLRequestDefaults.idleTimeout = 120000; //note this value represents milliseconds (120 secs)

Have a look here for more details : Flex HTTPService times out anyway

这篇关于Adobe Flex 4.6 WebService 请求超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆