1
votes

I have developed an application using Dojo 1.9.
In it I am trying to fetch data from SOAP web service using HTTP Adapter.

After Build All and Deploy when previewing the application in Worklight Console's MBS it works fine (see screen shot #1 below), same as on Android 2.2 AVD (see screen shot #2).

When running the app on an actual device it always returns "Request Failed!"

Is there any way to make it work on actual device which is connected to another network ?

Did i miss the SOAP message creation in the impl.js file?

Is that necessary to make a SOAP request call?

If yes, Will you please tell me how can i generate SOAP message?

Adapter BseNsePrice-impl.js:

function BSENSEPrice(Exchng) {
    var path = 'ClientStockService.asmx/BSENSEPrice';

    var input = {
        method : 'get',
        returnedContentType : 'text/xml; charset=utf-8',
        path : path,
        parameters: {'Exchng': Exchng} 
    };

    return WL.Server.invokeHttp(input);

}

Application JavaScript:

function wlCommonInit(){
    require([ "layers/core-web-layer", "layers/mobile-ui-layer" ], dojoInit);

}

function dojoInit() {
    require([ "dojo/ready", "dojo/parser", "dojox/mobile", "dojo/dom", "dijit/registry", "dojox/mobile/ScrollableView", "dojox/mobile/Heading", "dojox/mobile/RoundRectList", "dojox/mobile/ListItem", "dojox/mobile/View", "dojox/mobile/Container", "dojox/mobile/ContentPane", "dojox/mobile/TabBar", "dojox/mobile/TabBarButton" ], function(ready) {
        ready(function() {
        });
    });
}


function mobBSENSEPrice(Exchng) {
       var invocationData = {
               adapter : 'BSENSEPrice',
               procedure : 'BSENSEPrice',
               parameters : []
           };

       WL.Client.invokeProcedure(invocationData,{
           onSuccess : mobBSENSEPriceSuccess,
           onFailure : mobBSENSEPriceFailure,
       });
   };

 function mobBSENSEPriceSuccess(result) {
       var httpStatusCode = result.status;
       var div = $("#invokeResult");
       /*var span = $("#value");*/
       if (200 == httpStatusCode) {
           var invocationResult = result.invocationResult;
           var isSuccessful = invocationResult.isSuccessful;
           if (true == isSuccessful) {

               var data = invocationResult.DataSet.diffgram.NewDataSet.Table;
               for (var i=0;i<data.length;i++)
               {
                div.append(data[i].SYMBOL);
                div.append('<br>');
                div.append(data[i].PRICE);
                div.append('<br>');
                div.append('<strong>Change:</strong> ' + data[i].PER_CHANGE);
                div.append('<br>');
                div.append('<strong>Change(%) :</strong> ' + data[i].ChangePer);
                div.append('<br>');
                div.append('<br>');
               }
           }
           else {
               div.append("Request Failed....!");
           }                    
       }
       else {
           div.append("Request Failed!");
       }
   }

  function mobBSENSEPriceFailure(result){
            var div = $("#invokeResult");
        div.append("Request Failed!");
   }

LogCat:

07-24 11:27:08.227: I/dalvikvm(326): Could not find method org.apache.cordova.CordovaWebView.setOverScrollMode, referenced from method org.apache.cordova.DroidGap.init
07-24 11:27:08.227: W/dalvikvm(326): VFY: unable to resolve virtual method 12024: Lorg/apache/cordova/CordovaWebView;.setOverScrollMode (I)V
07-24 11:27:08.227: D/dalvikvm(326): VFY: replacing opcode 0x6e at 0x0043
07-24 11:27:08.267: I/CordovaLog(326): Changing log level to DEBUG(3)
07-24 11:27:08.277: I/CordovaLog(326): Found preference for exit-on-suspend=false
07-24 11:27:08.277: D/CordovaLog(326): Found preference for exit-on-suspend=false
07-24 11:27:08.277: D/DroidGap(326): DroidGap.onCreate()
07-24 11:27:08.317: I/dalvikvm(326): Could not find method android.webkit.WebView.<init>, referenced from method org.apache.cordova.CordovaWebView.<init>
07-24 11:27:08.317: W/dalvikvm(326): VFY: unable to resolve direct method 536: Landroid/webkit/WebView;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;IZ)V
07-24 11:27:08.317: D/dalvikvm(326): VFY: replacing opcode 0x70 at 0x0001
07-24 11:27:08.317: D/dalvikvm(326): VFY: dead code 0x0004-0046 in Lorg/apache/cordova/CordovaWebView;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;IZ)V
07-24 11:27:08.737: D/JsMessageQueue(326): Set native->JS mode to 2
07-24 11:27:08.737: I/CordovaWebView(326): Disabled addJavascriptInterface() bridge since Android version is old.
07-24 11:27:08.767: E/dalvikvm(326): Could not find class 'android.webkit.WebResourceResponse', referenced from method org.apache.cordova.CordovaWebViewClient.getWhitelistResponse
07-24 11:27:08.767: W/dalvikvm(326): VFY: unable to resolve new-instance 176 (Landroid/webkit/WebResourceResponse;) in Lorg/apache/cordova/CordovaWebViewClient;
07-24 11:27:08.767: D/dalvikvm(326): VFY: replacing opcode 0x22 at 0x000b
07-24 11:27:08.767: D/dalvikvm(326): VFY: dead code 0x000d-0014 in Lorg/apache/cordova/CordovaWebViewClient;.getWhitelistResponse ()Landroid/webkit/WebResourceResponse;
07-24 11:27:08.777: W/dalvikvm(326): VFY: unable to find class referenced in signature (Landroid/webkit/WebResourceResponse;)
07-24 11:27:08.777: W/dalvikvm(326): VFY: unable to find class referenced in signature (Landroid/webkit/WebResourceResponse;)
07-24 11:27:08.777: W/dalvikvm(326): VFY: unable to find class referenced in signature (Landroid/webkit/WebResourceResponse;)
07-24 11:27:08.797: D/DroidGap(326): DroidGap.init()
07-24 11:27:08.937: I/UICAndroid(326): {LoggingLevel=3, AddCookieDomain=false, PostMessageTimeout=60000, CookiePath=/, CookieParam=, KillSwitchTimeInterval=180, BufferPercent=20, HasToPersistLocalCache=true , MessageTypeHeader=WorklightHit, CookieDomain=, WhiteListParam=id, LibraryVersion=8.8.1.0, MaskIdList=com.tealeaf.sp:id/EditText*,com.tealeaf.sp:id/login.password, PostMessageLevelWiFi=3, UseRandomSample=false, KillSwitchMaxNumberOfTries=3, SensitiveCapitalCaseAlphabet=X, FilterMessageTypes=true, PostMessageTimeIntervals=30, SensitiveSmallCaseAlphabet=x, CompressPostMessage=true, PostMessageMaxBytesSize=20000, SensitiveSymbol=#, PostMessageLevelCellular=3, MessageTypes=4,5,6, PostMessageSocketTimeout=60000, CookieUrl=, UseWhiteList=true, KillSwitchUrl=, KillSwitchEnabled=false, MessageVersion=2.1.0.0, HasMasking=true, TimeIntervalBetweenSnapshots=60, PostMessageUrl=@USE_WORKLIGHT_DEFAULT@, CachedFileMaxBytesSize=512000, BufferLimit=100, AddCookiePath=false, SensitiveNumber=9, CachingLevel=3, ManualPostEnabled=true, HasCustomMask=true, DisplayLogging=true, MaxStringsLength=300, AddMessageTypeHeader=true, RandomSampleParam=, DoPostOnIntervals=false}
07-24 11:27:09.118: D/dalvikvm(326): GC_FOR_MALLOC freed 3477 objects / 255912 bytes in 101ms
07-24 11:27:09.257: I/UICAndroid(326): Screen height:420  Screen width780
07-24 11:27:09.317: D/DroidGap(326): Resuming the App
07-24 11:27:09.327: D/WLDroidGap(326): New installation/upgrade detected, copying resources and saving new checksum
07-24 11:27:09.417: I/UICAndroid(326): Network changed
07-24 11:27:09.447: D/SoftKeyboardDetect(326): Ignore this event
07-24 11:27:09.567: D/SoftKeyboardDetect(326): Ignore this event
07-24 11:27:09.698: D/WLDroidGap(326): Started copying files to local storage...
07-24 11:27:09.987: I/UICAndroid(326): Did Client State change?: true
07-24 11:27:13.757: D/dalvikvm(326): GC_FOR_MALLOC freed 3411 objects / 478752 bytes in 54ms
07-24 11:27:14.618: D/dalvikvm(326): GC_FOR_MALLOC freed 1944 objects / 461952 bytes in 52ms
07-24 11:27:17.138: D/dalvikvm(326): GC_FOR_MALLOC freed 1855 objects / 468928 bytes in 73ms
07-24 11:27:19.058: D/dalvikvm(326): GC_FOR_MALLOC freed 2204 objects / 516816 bytes in 57ms
07-24 11:27:20.668: D/dalvikvm(326): GC_FOR_MALLOC freed 2098 objects / 483856 bytes in 50ms
07-24 11:27:21.418: D/dalvikvm(326): GC_FOR_MALLOC freed 1791 objects / 472968 bytes in 56ms
07-24 11:27:22.998: D/dalvikvm(326): GC_FOR_MALLOC freed 2105 objects / 498800 bytes in 55ms
07-24 11:27:24.683: D/dalvikvm(326): GC_FOR_MALLOC freed 2203 objects / 512160 bytes in 74ms
07-24 11:27:28.677: D/WLDroidGap(326): Finished copying files to local storage...
07-24 11:27:28.709: D/WLDroidGap(326): no need to check web resource integrity
07-24 11:27:28.797: D/dalvikvm(326): GC_FOR_MALLOC freed 2474 objects / 524672 bytes in 90ms
07-24 11:27:28.877: D/CordovaWebView(326): >>> loadUrl(file:///data/data/com.Accordfintech/files/www/skinLoader.html)
07-24 11:27:28.892: D/PluginManager(326): init()
07-24 11:27:28.907: D/CordovaWebView(326): >>> loadUrlNow()
07-24 11:27:28.977: D/DroidGap(326): onMessage(onPageStarted,file:///data/data/com.Accordfintech/files/www/skinLoader.html)
07-24 11:27:30.067: D/Cordova(326): onPageFinished(file:///data/data/com.Accordfintech/files/www/skinLoader.html)
07-24 11:27:30.067: D/Cordova(326): Trying to fire onNativeReady
07-24 11:27:30.067: D/DroidGap(326): onMessage(onNativeReady,null)
07-24 11:27:30.067: D/DroidGap(326): onMessage(onPageFinished,file:///data/data/com.Accordfintech/files/www/skinLoader.html)
07-24 11:27:30.837: D/CordovaLog(326): Falling back on PROMPT mode since _cordovaNative is missing. Expected for Android 3.2 and lower only.
07-24 11:27:30.837: I/Web Console(326): Falling back on PROMPT mode since _cordovaNative is missing. Expected for Android 3.2 and lower only. at file:///data/data/com.Accordfintech/files/www/default/wlclient/js/cordova.js:908
07-24 11:27:30.937: D/CordovaNetworkManager(326): Connection Type: 3g
07-24 11:27:30.937: D/CordovaNetworkManager(326): Connection Type: 3g
07-24 11:27:30.937: D/DroidGap(326): onMessage(networkconnection,3g)
07-24 11:27:30.977: D/DroidGap(326): onMessage(spinner,stop)
07-24 11:27:31.177: D/dalvikvm(326): GC_FOR_MALLOC freed 2179 objects / 213704 bytes in 137ms
07-24 11:27:31.267: D/CordovaWebView(326): >>> loadUrl(file:///data/data/com.Accordfintech/files/www/default/Accordfintech.html)
07-24 11:27:31.267: D/PluginManager(326): init()
07-24 11:27:31.277: D/CordovaWebView(326): >>> loadUrlNow()
07-24 11:27:31.318: D/DroidGap(326): onMessage(onPageStarted,file:///data/data/com.Accordfintech/files/www/default/Accordfintech.html)
07-24 11:27:31.597: D/dalvikvm(326): GC_FOR_MALLOC freed 3136 objects / 267808 bytes in 65ms
07-24 11:27:31.817: D/dalvikvm(326): GC_FOR_MALLOC freed 1006 objects / 173440 bytes in 101ms
07-24 11:27:32.087: D/DroidGap(326): onMessage(spinner,stop)
07-24 11:27:40.138: D/Cordova(326): onPageFinished(file:///data/data/com.Accordfintech/files/www/default/Accordfintech.html)
07-24 11:27:40.148: D/Cordova(326): Trying to fire onNativeReady
07-24 11:27:40.148: D/DroidGap(326): onMessage(onNativeReady,null)
07-24 11:27:40.148: D/DroidGap(326): onMessage(onPageFinished,file:///data/data/com.Accordfintech/files/www/default/Accordfintech.html)
07-24 11:27:40.898: D/CordovaLog(326): Falling back on PROMPT mode since _cordovaNative is missing. Expected for Android 3.2 and lower only.
07-24 11:27:40.898: I/Web Console(326): Falling back on PROMPT mode since _cordovaNative is missing. Expected for Android 3.2 and lower only. at file:///data/data/com.Accordfintech/files/www/default/wlclient/js/cordova.js:908
07-24 11:27:40.958: D/CordovaNetworkManager(326): Connection Type: 3g
07-24 11:27:40.988: D/CordovaNetworkManager(326): Connection Type: 3g
07-24 11:27:40.988: D/DroidGap(326): onMessage(networkconnection,3g)
07-24 11:27:41.018: D/DroidGap(326): onMessage(spinner,stop)
07-24 11:27:41.198: I/dalvikvm(326): Could not find method java.util.Calendar.getDisplayNames, referenced from method org.apache.cordova.Globalization.getDateNames
07-24 11:27:41.198: W/dalvikvm(326): VFY: unable to resolve virtual method 10795: Ljava/util/Calendar;.getDisplayNames (IILjava/util/Locale;)Ljava/util/Map;
07-24 11:27:41.198: D/dalvikvm(326): VFY: replacing opcode 0x74 at 0x009d
07-24 11:27:41.198: I/dalvikvm(326): Could not find method java.util.Calendar.getDisplayNames, referenced from method org.apache.cordova.Globalization.getDateNames
07-24 11:27:41.198: W/dalvikvm(326): VFY: unable to resolve virtual method 10795: Ljava/util/Calendar;.getDisplayNames (IILjava/util/Locale;)Ljava/util/Map;
07-24 11:27:41.198: D/dalvikvm(326): VFY: replacing opcode 0x74 at 0x00d0
07-24 11:27:41.198: I/dalvikvm(326): Could not find method java.util.Calendar.getDisplayNames, referenced from method org.apache.cordova.Globalization.getDateNames
07-24 11:27:41.198: W/dalvikvm(326): VFY: unable to resolve virtual method 10795: Ljava/util/Calendar;.getDisplayNames (IILjava/util/Locale;)Ljava/util/Map;
07-24 11:27:41.198: D/dalvikvm(326): VFY: replacing opcode 0x74 at 0x00e3
07-24 11:27:41.198: I/dalvikvm(326): Could not find method java.util.Calendar.getDisplayNames, referenced from method org.apache.cordova.Globalization.getDateNames
07-24 11:27:41.198: W/dalvikvm(326): VFY: unable to resolve virtual method 10795: Ljava/util/Calendar;.getDisplayNames (IILjava/util/Locale;)Ljava/util/Map;
07-24 11:27:41.198: D/dalvikvm(326): VFY: replacing opcode 0x74 at 0x00f2
07-24 11:27:41.198: D/dalvikvm(326): VFY: dead code 0x00a0-00b8 in Lorg/apache/cordova/Globalization;.getDateNames (Lorg/json/JSONArray;)Lorg/json/JSONObject;
07-24 11:27:41.198: D/dalvikvm(326): VFY: dead code 0x00d3-00d4 in Lorg/apache/cordova/Globalization;.getDateNames (Lorg/json/JSONArray;)Lorg/json/JSONObject;
07-24 11:27:41.198: D/dalvikvm(326): VFY: dead code 0x00e6-00e7 in Lorg/apache/cordova/Globalization;.getDateNames (Lorg/json/JSONArray;)Lorg/json/JSONObject;
07-24 11:27:41.198: D/dalvikvm(326): VFY: dead code 0x00f5-0118 in Lorg/apache/cordova/Globalization;.getDateNames (Lorg/json/JSONArray;)Lorg/json/JSONObject;
07-24 11:27:41.388: D/Accordfintech(326): wlclient init started
07-24 11:27:41.428: D/Accordfintech(326): Read cookies: null
07-24 11:27:41.428: D/Accordfintech(326): CookieMgr read cookies: {}
07-24 11:27:41.618: D/dalvikvm(326): GC_FOR_MALLOC freed 5221 objects / 855328 bytes in 82ms
07-24 11:27:41.928: D/Accordfintech(326): before: app init onSuccess
07-24 11:27:42.018: D/Accordfintech(326): after: app init onSuccess
07-24 11:27:42.018: D/Accordfintech(326): added onPause event handler 
07-24 11:27:42.028: D/Accordfintech(326): wlclient init success
07-24 11:27:59.578: D/Accordfintech(326): Request [http://10.20.50.244:10080/Accord/apps/services/api/Accordfintech/android/query]
07-24 11:28:00.369: D/dalvikvm(326): GC_FOR_MALLOC freed 7040 objects / 435712 bytes in 63ms
07-24 11:28:00.629: D/Accordfintech(326): Request [http://10.20.50.244:10080/Accord/apps/services/api/Accordfintech/android/query]
07-24 11:28:00.698: D/Accordfintech(326): Request [http://10.20.50.244:10080/Accord/apps/services/api/Accordfintech/android/query]
07-24 11:28:01.038: D/Accordfintech(326): response [http://10.20.50.244:10080/Accord/apps/services/api/Accordfintech/android/query] success: /*-secure-
07-24 11:28:01.038: D/Accordfintech(326): {"responseID":"2","statusCode":200,"errors":[],"isSuccessful":true,"statusReason":"OK","WL-Authentication-Success":{"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"wl_antiXSRFRealm":{"userId":"88cgj8s4m26caj0vstt6imlief","attributes":{},"isUserAuthenticated":1,"displayName":"88cgj8s4m26caj0vstt6imlief"},"wl_deviceNoProvisioningRealm":{"userId":"cf95dc53-f383-39a8-b6fd-749f3ef439cd","attributes":{"mobileClientData":"com.worklight.core.auth.ext.MobileClientData@59727ed4"},"isUserAuthenticated":1,"displayName":"cf95dc53-f383-39a8-b6fd-749f3ef439cd"},"wl_anonymousUserRealm":{"userId":"587f3a3b-148c-492a-9fa5-7bdbb8b9e046","attributes":{},"isUserAuthenticated":1,"displayName":"587f3a3b-148c-492a-9fa5-7bdbb8b9e046"}},"DataSet":{"schema":{"id":"NewDataSet","element":{"complexType":{"choice":{"element":{"complexType":{"sequence":{"element":[{"name":"SYMBOL","type":"xs:string","minOccurs":"0"},{"name":"PRICE","type":"xs:decimal","minOccurs":"0"},{"name":"PER_CHANGE","type":"xs:decimal","minOccurs":"0"},{"name":"ChangePer","type":"xs:decimal","minOccurs":"0"},{"name":"PREV_CLOSE","type":"xs:decimal","minOccurs":"0"},{"name":"Open","type":"xs:decimal","minOccurs":"0"},{"name":"UPD_TIME","type":"xs:string","minOccurs":"0"},{"name":"Trend","type":"xs:string","minOccurs":"0"},{"name":"high","type":"xs:double","minOccurs":"0"},{"name":"low","type":"xs:double","minOccurs":"0"}]}},"name":"Table"},"maxOccurs":"unbounded","minOccurs":"0"}},"name":"NewDataSet","IsDataSet":"true","UseCurrentLocale":"true"},"msdata":"urn:schemas-microsoft-com:xml-msdata","xs":"http:\/\/www.w3.org\/2001\/XMLSchema","xmlns":""},"xmlns":"http:\/\/ACEwebservice\/","diffgram":{"NewDataSet":{"Table":[{"id":"Table1","Open":"20200.20","PRICE":"20041.68","PREV_CLOSE":"20302.13","PER_CHANGE":"-260.45","SYMBOL":"SENSEX","ChangePer":"-1.28","high":"20252.7","low":"20018.32","rowOrder":"0","Trend":"-","UPD_TIME":"24-Jul-2013 11:25"},{"id":"Table2","Open":"6032.20","PRICE":"5974.95","PREV_CLOSE":"6077.80","PER_CHANGE":"-102.85","SYMBOL":"NIFTY","ChangePer":"-1.69","high":"6047.25","low":"5968.4","rowOrder":"1","Trend":"-","UPD_TIME":"24-Jul-2013 11:15"}],"xmlns":""},"msdata":"urn:schemas-microsoft-com:xml-msdata","diffgr":"urn:schemas-microsoft-com:xml-diffgram-v1"}},"responseHeaders":{"X-AspNet-Version":"2.0.50727","Date":"Wed, 24 Jul 2013 06:00:48 GMT","Content-Length":"2480","Expires":"-1","Content-Type":"text\/xml; charset=utf-8","Server":"Microsoft-IIS\/6.0","X-Powered-By":"ASP.NET","Cache-Control":"no-cache","Pragma":"no-cache"},"warnings":[],"totalTime":140,"responseTime":139,"info":[]}*/
07-24 11:28:01.268: D/Accordfintech(326): response [http://10.20.50.244:10080/Accord/apps/services/api/Accordfintech/android/query] success: /*-secure-
07-24 11:28:01.268: D/Accordfintech(326): {"responseID":"3","statusCode":200,"errors":[],"isSuccessful":true,"statusReason":"OK","DataSet":{"schema":{"id":"NewDataSet","element":{"complexType":{"choice":{"element":{"complexType":{"sequence":{"element":[{"name":"SYMBOL","type":"xs:string","minOccurs":"0"},{"name":"PRICE","type":"xs:decimal","minOccurs":"0"},{"name":"PER_CHANGE","type":"xs:decimal","minOccurs":"0"},{"name":"ChangePer","type":"xs:decimal","minOccurs":"0"},{"name":"PREV_CLOSE","type":"xs:decimal","minOccurs":"0"},{"name":"Open","type":"xs:decimal","minOccurs":"0"},{"name":"UPD_TIME","type":"xs:string","minOccurs":"0"},{"name":"Trend","type":"xs:string","minOccurs":"0"},{"name":"high","type":"xs:double","minOccurs":"0"},{"name":"low","type":"xs:double","minOccurs":"0"}]}},"name":"Table"},"maxOccurs":"unbounded","minOccurs":"0"}},"name":"NewDataSet","IsDataSet":"true","UseCurrentLocale":"true"},"msdata":"urn:schemas-microsoft-com:xml-msdata","xs":"http:\/\/www.w3.org\/2001\/XMLSchema","xmlns":""},"xmlns":"http:\/\/ACEwebservice\/","diffgram":{"NewDataSet":{"Table":[{"id":"Table1","Open":"20200.20","PRICE":"20041.68","PREV_CLOSE":"20302.13","PER_CHANGE":"-260.45","SYMBOL":"SENSEX","ChangePer":"-1.28","high":"20252.7","low":"20018.32","rowOrder":"0","Trend":"-","UPD_TIME":"24-Jul-2013 11:25"},{"id":"Table2","Open":"6032.20","PRICE":"5974.95","PREV_CLOSE":"6077.80","PER_CHANGE":"-102.85","SYMBOL":"NIFTY","ChangePer":"-1.69","high":"6047.25","low":"5968.4","rowOrder":"1","Trend":"-","UPD_TIME":"24-Jul-2013 11:15"}],"xmlns":""},"msdata":"urn:schemas-microsoft-com:xml-msdata","diffgr":"urn:schemas-microsoft-com:xml-diffgram-v1"}},"responseHeaders":{"X-AspNet-Version":"2.0.50727","Date":"Wed, 24 Jul 2013 06:00:48 GMT","Content-Length":"2480","Expires":"-1","Content-Type":"text\/xml; charset=utf-8","Server":"Microsoft-IIS\/6.0","X-Powered-By":"ASP.NET","Cache-Control":"no-cache","Pragma":"no-cache"},"warnings":[],"totalTime":181,"responseTime":180,"info":[]}*/

Screen shot #1 - Worklight Console MBS:
enter image description here

Screen shot #2 - Android 2.2. AVD:
enter image description here

1
have you look at Logcat what is the problem or you can paste your logcat here ???BBdev
Add the LogCat output to your question. Also add your implementation to the question.Idan Adar
It works fine on avd but not on actual device only ?UjjawalKr
Can you pleas add the information you've been asked for?Idan Adar
edited my question with all the details you need.Please let me know if i have left something?UjjawalKr

1 Answers

0
votes

If your application fails to connect to the Worklight server, adapter procedures will also fail. When deploying to a real device ensure you explicitly specify the Worklight server's ip address by running "build for remote server" after "build all and deploy". By default "build all and deploy" will use localhost to target the Worklight server which will result in a connection error on a real device.

Build for remote server screetshot

To verify that your connection failure is the result of an incorrect server address use the hardware menu button to bring up the Worklight settings menu while your app is open. From there check the "change server url" box and ensure the url below targets the ip address of the Worklight server.

Worklight settings screenshot