1

I want to develop on my Windows machine and push my changes to an iPad (iOS 7.1.2) test device via direct update. This worked for me in WL 6.1, but since my update to WL 6.2 I'm having some issues. Following scenario describes my problem.

  1. Create new WL project and add iPad as environment
  2. Enabled worklightSettings in application-descriptor.xml
  3. Add the code snippet below to main.js
  4. Run on Worklight Development Server
  5. Open project in Xcode via eclipse
  6. Clean project in Xcode and run on iPad
  7. Make a change, re-deploy and verify Direct Update is received
  8. Copy the project to a Windows machine and open in eclipse
  9. Run on Worklight Development Server on Windows machine
  10. Open the app settings via Settings.app and enable use Custom Server URL
  11. Replace the IP of your mac by the IP of your windows machine
  12. On windows: Make a change and re-deploy
  13. Restart the app on the iPad

The moment I restart my app I get the following exception in my In the worklight development server console on my Windows machine:

[WARNING ] SRVE0190E: File not found: //apps/services/api/HelloDirectUpdate/ipad/init
[ERROR   ] FWLSE0048E: Unhandled exception caught: SRVE0190E: File not found: //apps/services/api/HelloDirectUpdate/ipad/init

When I modify the custom server URL and I remove the last slash, I get the message that an update is available. But when I click update the progress bar in the downloading popup doesn't move. My Windows machine and MAC both have the following WL Studio version: platformVersion="6.2.0.00.20140724-2139". What am I doing wrong?

main.js

function wlCommonInit(){
    WL.Client.connect({
        onSuccess: onConnectSuccess,
        onFailure: onConnectFailure
    });
}

function onConnectSuccess() {
    WL.Logger.debug("Connect success.");
}

function onConnectFailure() {
    WL.Logger.debug("Connect failed.");
}
4

1 回答 1

2

这确实是 Worklight 6.2 中的一个缺陷。

一方面,正如您在复制步骤中提到的,您需要从自定义服务器 URL 中删除前斜杠,以便能够连接到 Worklight Server(因为否则 URL 中有 2 个斜杠并且连接失败) .

另一方面,客户端需要这个正斜杠。
您可以在 Wireshark 中看到:

坏:GET / test3directUpdate /test3/iphone/1.0?skin=default HTTP/1.1
好:GET / test3/directUpdate /test3/iphone/1.0?skin=default HTTP/1.1

我为此打开了一个缺陷;您将需要创建一个 PMR以接收可用的修复(或等到它通过 IBM Fix Central / Eclipse Marketplace 公开可用)。

于 2014-08-04T11:30:54.833 回答