Hans
Hans

Reputation: 729

Direct update on iPad to Worklight Studio development server on Windows not working

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.");
}

Upvotes: 1

Views: 223

Answers (1)

Idan Adar
Idan Adar

Reputation: 44516

This is indeed a defect in Worklight 6.2.

On the one hand, as you mention in your reproduction steps you need to remove the forweawrd slash from the custom server URL in order to be able to connect to the Worklight Server (because otherwise there are 2 slashes in the URL and it fails connecting).

On the other hand, the client requires this forward slash.
You can see this in Wireshark:

Bad: GET /test3directUpdate/test3/iphone/1.0?skin=default HTTP/1.1
Good: GET /test3/directUpdate/test3/iphone/1.0?skin=default HTTP/1.1

I've opened a defect for this; you will need to create a PMR in order to receive a fix, once available (or wait until it is publicly available via IBM Fix Central / Eclipse Marketplace).

Upvotes: 2

Related Questions