我們已經使用Worklight 6.1
爲iOS5
,iOS6
& IOS7
構建了一個應用程序,它的工作狀態非常好。IBM Worklight 6.1 - 如何處理較慢網絡中的超時?
但是,當我們試圖在2G網絡中嘗試使用應用程序並嘗試調用適配器過程時,它甚至未連接到服務器。每次嘗試10-15次時,我們都會得到一個超時時間,它會連接到服務器並給予迴應。
當我們在其他良好的網絡或3G上使用相同的應用程序時,它沒有問題就很好地工作。
這是日誌這在Xcode管理控制檯,我們本身在使用2G網絡:
Jan 17 16:50:53 My-iPad Sec Sec[292] <Warning>: WLRequestBuilder.initWithRootUrl else_url: https://domain.com:443/MyApp/apps/services/api/MyApp/ipad/0/query
Jan 17 16:50:55 My-iPad Sec Sec[292] <Warning>: LSHelperClient: Session started with polling: NO
Jan 17 16:50:59 My-iPad Sec Sec[292] <Warning>: Incorrect NSStringEncoding value 0x0000 detected. Assuming NSASCIIStringEncoding. Will stop this compatiblity mapping behavior in the near future.
Jan 17 16:50:59 My-iPad Sec Sec[292] <Warning>: [ERROR] Worklight: -[WLRequest requestFailed:]:338::Status code='0' error='The request timed out'
Jan 17 16:50:59 My-iPad Sec Sec[292] <Warning>: Incorrect NSStringEncoding value 0x0000 detected. Assuming NSASCIIStringEncoding. Will stop this compatiblity mapping behavior in the near future.
Jan 17 16:50:59 My-iPad Sec Sec[292] <Warning>: Incorrect NSStringEncoding value 0x0000 detected. Assuming NSASCIIStringEncoding. Will stop this compatiblity mapping behavior in the near future.
Jan 17 16:50:59 My-iPad Sec Sec[292] <Warning>: [ERROR] Worklight: -[WLClient onInvokeProcedureFailure:userInfo:]:696::response string=''
Jan 17 16:50:59 My-iPad kernel[0] <Debug>: AppleAP3GDL::handleInterrupt2 FIFO is Empty
Jan 17 16:51:08 My-iPad Sec Sec[292] <Warning>: WLRequestBuilder.initWithRootUrl else_url: https://domain.com:443/MyApp/apps/services/api/MyApp/ipad/0/query
Jan 17 16:51:14 My-iPad Sec Sec[292] <Warning>: Incorrect NSStringEncoding value 0x0000 detected. Assuming NSASCIIStringEncoding. Will stop this compatiblity mapping behavior in the near future.
Jan 17 16:51:14 My-iPad Sec Sec[292] <Warning>: [ERROR] Worklight: -[WLRequest requestFailed:]:338::Status code='0' error='The request timed out'
Jan 17 16:51:14 My-iPad Sec Sec[292] <Warning>: Incorrect NSStringEncoding value 0x0000 detected. Assuming NSASCIIStringEncoding. Will stop this compatiblity mapping behavior in the near future.
Jan 17 16:51:14 My-iPad Sec Sec[292] <Warning>: Incorrect NSStringEncoding value 0x0000 detected. Assuming NSASCIIStringEncoding. Will stop this compatiblity mapping behavior in the near future.
Jan 17 16:51:14 My-iPad Sec Sec[292] <Warning>: [ERROR] Worklight: -[WLClient onInvokeProcedureFailure:userInfo:]:696::response string=''
Jan 17 16:51:17 My-iPad Sec Sec[292] <Warning>: WLRequestBuilder.initWithRootUrl else_url: https://domain.com:443/MyApp/apps/services/api/MyApp/ipad/0/query
Jan 17 16:51:23 My-iPad Sec Sec[292] <Warning>: Incorrect NSStringEncoding value 0x0000 detected. Assuming NSASCIIStringEncoding. Will stop this compatiblity mapping behavior in the near future.
Jan 17 16:51:23 My-iPad Sec Sec[292] <Warning>: [ERROR] Worklight: -[WLRequest requestFailed:]:338::Status code='0' error='The request timed out'
Jan 17 16:51:23 My-iPad Sec Sec[292] <Warning>: Incorrect NSStringEncoding value 0x0000 detected. Assuming NSASCIIStringEncoding. Will stop this compatiblity mapping behavior in the near future.
Jan 17 16:51:23 My-iPad Sec Sec[292] <Warning>: Incorrect NSStringEncoding value 0x0000 detected. Assuming NSASCIIStringEncoding. Will stop this compatiblity mapping behavior in the near future.
Jan 17 16:51:23 My-iPad Sec Sec[292] <Warning>: [ERROR] Worklight: -[WLClient onInvokeProcedureFailure:userInfo:]:696::response string=''
Jan 17 16:51:33 My-iPad Sec Sec[292] <Warning>: WLRequestBuilder.initWithRootUrl else_url: https://domain.com:443/MyApp/apps/services/api/MyApp/ipad/0/query
Jan 17 16:51:40 My-iPad Sec Sec[292] <Warning>: DeviceAuthManager:getWorklightUniqueDeviceId --> returning UUID from the keychain
Jan 17 16:51:40 My-iPad Sec Sec[292] <Warning>: WLRequestBuilder.initWithRootUrl else_url: https://domain.com:443/MyApp/apps/services/api/MyApp/ipad/0/query
讓我知道會有怎樣的問題,還有什麼我們能爲它做的。我們的後端API非常快,在毫秒內我們得到了迴應。
我們確實在程序方面內容:
var timeout = 600000;
var invocationOptions = {
onSuccess: LoginSuccess,
onFailure: LoginFail,
timeout: timeout
};
而且在適配器XML文件:
<procedure name="Authentication" requestTimeoutInSeconds="600000"/>
我們已經嘗試過這種實驗,HTTP和HTTPS都和有同樣的問題(獲取時間出)。
當我們啓動應用程序時,我們得到wlclient init success
。
是的,我們已經嘗試過這些東西,但沒有用。在做了如此多的研發和變更後,我們在Stackoverflow上發佈。 –
這是什麼意思?你嘗試過什麼設置?你有沒有嘗試例如10分鐘的invokeProcedure和程序,但它仍然失敗?編輯問題並詳細說明你所做的「實驗」,因爲你根本沒有提到這一點。 –
另外,你是否嘗試了HTTP而不是HTTPS的實驗?有區別嗎?哪個功能失敗?這是登錄嗎?連接到服務器?一些數據檢索程序?什麼失敗? –