连接到我的WebService (Lotus Notes数据库)的代码是由Flash Builder通过"Data/Connect with WebService...“创建的。一切正常,但我有一个问题,以增加请求超时。API说明您可以这样设置请求超时时间:
_serviceControl.requestTimeout = 300;在iOS (iPad)上,似乎一切正常。但是,如果我在桌面或android智能手机上运行我的应用程序,这只有在我将请求超时设置在~30秒以下时才能起作用。如果我没有设置请求超时或大于30,并且我的应用程序等待应答/结果的时间超过30秒,则"_serviceControl“将触发一个FaultEvent,并显示以下消息:
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知道为什么会这样吗?
发布于 2013-03-14 23:52:45
我也有同样的问题,requestTimeout不能工作。
如果有人在寻找答案,这个配置对我来说很好:
import flash.net.URLRequestDefaults;
URLRequestDefaults.idleTimeout = 120000; //note this value represents milliseconds (120 secs)请在此处查看更多详细信息:Flex HTTPService times out anyway
发布于 2014-05-23 06:03:34
尽管它似乎假设requestTimeout不工作。实际上是这样的。第一次。
在第一个请求之后,将requestTimeout设置为
HTTPService.channelSet.currentChannel.requestTimeout如果您必须更改超时,您将希望在那里更改。
要查看具体的违规代码,请参阅AbstractOperation.getDirectChannelSet()。即使对于不同的HTTPService实例,它也是从:
private static var _directChannelSet:ChannelSet;_directChannelSet只实例化一次,并且其上的requestTimeout仅在创建时设置,因此即使您更改了HTTPService上的requestTimeout,它也不会反映在请求中。
https://stackoverflow.com/questions/10598860
复制相似问题