0

我们使用的是 WL 5.0.6.1,我们没有在文档中找到所有信息。

http://pic.dhe.ibm.com/infocenter/wrklight/v5r0m6/topic/com.ibm.worklight.help.doc/apiref/r_wl_client_connect.html

  • onSuccess(??) 是否接收任何参数/对象作为输入?如果是这样,什么类型/JSON 结构?
  • onFailure 接收 WL.FailResponse 输入对象 - 是否有可用的类型/JSON-Structure 定义?

在: http: //pic.dhe.ibm.com/infocenter/wrklight/v5r0m6/topic/com.ibm.worklight.help.doc/apiref/r_wl_client_invokeprocedure.html

  • 它说:“故障处理程序接收标准响应对象。” ...是否有“标准响应对象”的类型定义?

在: http: //pic.dhe.ibm.com/infocenter/wrklight/v5r0m6/topic/com.ibm.worklight.help.doc/apiref/r_wl_client_setheartbeatinterval.html

在 WorkingOffline PDF: http ://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v600/05_04_Working_offline.pdf 它说:“ WL.Events.WORKLIGHT_IS_CONNECTED 和 WL.Events.WORKLIGHT_IS_DISCONNECTED 事件都可以在指定情况下被心跳解雇”

  • 这些“指定案件”是什么?
    • 当心跳第一次(或每次)无法连接到服务器时,会触发事件 WL.Events.WORKLIGHT_IS_DISCONNECTED 吗?
    • 一旦 WL.Events.WORKLIGHT_IS_DISCONNECTED 被触发,心跳会继续运行/尝试,还是需要手动重置/重新启动?
    • 如果它继续运行,一旦心跳再次成功连接到服务器,是否会触发事件 WL.Events.WORKLIGHT_IS_CONNECTED?
4

1 回答 1

0

onSuccess 上的对象可以是您从后端返回的任何 (JSON) 对象,该对象包含在 invocationResult 以及 isSuccessful 和 errors 属性中:

An object that contains the data that is returned by the invoked procedure, and the invocation status. Its format is as follows:
**invocationResult = {
    isSuccessful: Boolean,
    errors : "Error Message"
    // Procedure results go here
}**
Where:

isSuccessful – Contains true if the procedure invocation succeeded, false otherwise. If the invocation failed, the failure handler for the request is called.
errors – An optional array of strings containing error messages.

对于失败:

The procedure was called but failed. In this case, the invocationResult property is added to the response received by the failure handler. This property has the same structure as the invocationResult property returned to the success handler, but the value of the isSuccessful attribute is false. For the structure of the invocationResult property, see invocationResult.
于 2013-08-22T21:19:49.730 回答