Worklight 5.0.6文档 - 开放式问题:“WL.FailResponse”,“标准响应对象”,“指定案例中的心跳”

时间:2013-08-22 18:58:57

标签: ibm-mobilefirst

我们正在使用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结构定义?

目前: 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?

1 个答案:

答案 0 :(得分:0)

onSuccess上的对象可以是从invodeResult包含的后端返回的任何(JSON)对象以及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.