IBM Worklight 6.0.0.1 - 适配器中的超时设置 [英] IBM Worklight 6.0.0.1 - Timeout setting in Adapters
问题描述
如何使用 WL.Client.invokeProcedure
调用应用程序到适配器时更改超时?
How can I change the timeout when calling from the application to the adapter using WL.Client.invokeProcedure
?
我已经阅读了以下帖子中的答案,但它无效:
如何在Worklight中增加适配器程序超时值?
I have read the answer in the following post, but it is not working: How to increase the adapter procedure timeout value in Worklight?
我的配置:
initOptions.js
timeout: 600000
适配器XML
<procedure name="addInsertarMensaje" securityTest="wl_unprotected" requestTimeoutInSeconds="600">
适配器调用
var timeout = 600000;
var invocationOptions = {
onSuccess: successSynchDoc,
onFailure: errorSynchDoc,
invocationContext: context,
timeout: timeout
};
Android LogCat:
12-02 11:23:04.603: D/Mapfre(21661): MyCustomTrace: Invoking the adapter
12-02 11:23:05.564: D/Mapfre(21661): Request [http://192.168.1.39:10080/xxx/apps/services/api/Mapfre/android/query]
12-02 11:23:26.214: D/Mapfre(21661): MyCustomTrace: After invoking the adapter
12-02 11:24:29.297: E/Mapfre(21661): [http://192.168.1.39:10080/xxx/apps/services/api/Mapfre/android/query] Host is not responsive. Try to manually access the URL through the android emulator browser to verify connectivity.
是否有最大值?
Is there a max value?
这些是每个部分的痕迹。
These are the traces in each part.
在应用程序中:
12-02 14:30:24.473: D/Mapfre(8641): Custom Trace. Just befor WL.Client.invokeProcedure
12-02 14:30:25.103: D/Mapfre(8641): Request [http://192.168.1.39:10080/xxx/apps/services/api/Mapfre/android/query]
12-02 14:31:42.670: E/Mapfre(8641): [http://192.168.1.39:10080/xxx/apps/services/api/Mapfre/android/query] Host is not responsive. Try to manually access the URL through the android emulator browser to verify connectivity.
在从应用程序接收调用的适配器中:
In the adapter receiving the invocation from the app:
[2/12/13 14:31:45:224 CET] 000000bf ht.integration.js.JavaScriptIntegrationLibraryImplementation I Custom Trace. Into Adapter implementation.
在接收主机答案的适配器中:
In the adapter receiving the answer from the host:
[2/12/13 14:33:34:714 CET] 000000bf ht.integration.js.JavaScriptIntegrationLibraryImplementation I Custom Trace. Received id: 3
推荐答案
- 应用程序未调用适配器。基本图表:
- 此外,Worklight对超时没有最大值。有一个默认值,但您已经在所有3个位置更改了它。
-
在 initOptions.js 中,
超时
属性与时间量有关应用程序将等待与Worklight Server的连接。 In initOptions.js, the
timeout
property relates to the amount of time the app will wait for a connection to the Worklight Server.- 确认您可以到达服务器;按照错误消息中的说明进行操作 - 尝试在设备的移动浏览器中加载Worklight控制台
- 验证设备和服务器是否在同一网络中
- 验证防火墙(如果已启用)未阻止任何关键端口或地址
应用程序<< >> [Worklight Server<< >>适配器]<< >>后端
Application << >>[ Worklight Server << >> Adapter ]<< >> Backend
简短说明:
在适配器的XML 中, requestTimeoutInSeconds
属性与Worklight Server等待来自后端的响应的时间有关。
In the adapter's XML, the requestTimeoutInSeconds
property relates to the amount of time the Worklight Server will wait for a response from the Backend.
在调用中选项,超时
属性与应用等待Worklight Server响应的时间有关。
In the invocation options, the timeout
property relates to the amount of time the app will wait for a response from the Worklight Server.
在您的情况下,您甚至没有到达Worklight Server的错误点,更不用说调用适配器过程了。
In your case, the error points that you did not even reach the Worklight Server, let alone invoke the adapter procedure.
如果您确实访问了Worklight Server,那么显然600秒没有通过,我相信主机根本无法访问。确保您指向正确的主机地址,并且没有任何东西妨碍连接成功通过。
In case you did reach the Worklight Server, since obviously 600 seconds did not pass, I believe that the host is simply not reachable. Make sure that you are pointing to the correct host address and that nothing is preventing a connection to pass successfully.
如果找到主机,其他内容不正确路径或网络,将返回响应,但不会等待600秒。
If the host was found, and something else is not correct in the path or network, a response will be returned, but it will not wait 600 seconds.
这篇关于IBM Worklight 6.0.0.1 - 适配器中的超时设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!