连接到我的 WebService(Lotus Notes 数据库)的代码是由 Flash Builder 通过“Data/Connect with WebService...”创建的。一切正常,但我有一个增加请求超时的问题。API 说您可以像这样设置请求超时:
_serviceControl.requestTimeout = 300;
在 iOS (iPad) 上似乎一切正常。但是,如果我在桌面或安卓智能手机上运行我的应用程序,这只有在我将请求超时设置为低于 ~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
知道为什么会这样吗?