windows phone 8 - WP8 not show error when onFailure invoke http adapter hybrid Mobilefirst 7.1 -


this issue on wp8 (android, ios, , bb10 fine).

sample code when call adapter :

var invocationdata = {     adapter : appadaptername,     procedure : 'checksignature',     parameters : [arg0, arg1] };  wl.client.invokeprocedure(invocationdata, {     onsuccess : checksignaturesuccess,     onfailure : checksignaturefailure }); 

handle success :

function checksignaturesuccess(result){     alert("success"); } 

handle error :

function checksignaturefailure(result){         alert(result.errorcode);     } 

when turn off back-end service, on android, ios , bb10 can show alert "procedure_error". on wp8, not showing alert.

this log message.log when back-end service down.

    response: not found server=apache-coyote/1.1 content-type=text/html;charset=utf-8 content-length=1144 date=thu, 22 sep 2016 11:22:05 gmt <html><head><title>xxxxxxxx</title><style><!--h1 {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;font-size:22px;} h2 {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;font-size:16px;} h3 {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;font-size:14px;} body {font-family:tahoma,arial,sans-serif;color:black;background-color:white;} b {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;} p {font-family:tahoma,arial,sans-serif;background:white;color:black;font-size:12px;}a {color : black;}a.name {color : black;}hr {color : #525d76;}--></style> </head><body><h1>xxxxxx: http status 404 - xxxxxxxxxxxxxxxxxxxxxxxxxxxx</h1><hr size="1" noshade="noshade"><p><b>xxxxxx: type</b> xxxxxx: status report</p><p><b>xxxxx: message</b> <u>xxxxxxxxxxxxxxxxxxxxxxxxx</u></p><p><b>xxxxxx: description</b> <u>xxxxxxxx: requested resource not available.</u></p><hr size="1" noshade="noshade"><h3>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</h3></body></html> [project xxxxx] [9/22/16 18:20:00:102 ict] 00000127 om.worklight.integration.services.impl.dataaccessserviceimpl e fwlse0099e: error occurred while invoking procedure  [project xxxxx]applicationhttpadapter/checksignature:  parameters: [project xxxxx] typeerror: cannot read property "body" undefined (2016-09-22t17:04:18.759z/6733847e906e1c3f58643f980a1375aa2209260b/applicationhttpadapter-impl.js#121) fwlse0101e: caused by:  [project xxxxx]nullorg.mozilla.javascript.ecmaerror: typeerror: cannot read property "body" undefined (2016-09-22t17:04:18.759z/6733847e906e1c3f58643f980a1375aa2209260b/applicationhttpadapter-impl.js#121)     @ org.mozilla.javascript.scriptruntime.constructerror(scriptruntime.java:3687)     @ org.mozilla.javascript.scriptruntime.constructerror(scriptruntime.java:3665)     @ org.mozilla.javascript.scriptruntime.typeerror(scriptruntime.java:3693)     @ org.mozilla.javascript.scriptruntime.typeerror2(scriptruntime.java:3712)     @ org.mozilla.javascript.scriptruntime.undefreaderror(scriptruntime.java:3725)     @ org.mozilla.javascript.scriptruntime.getobjectprop(scriptruntime.java:1483)     @ org.mozilla.javascript.gen._2016_09_22t17_04_18_759z_6733847e906e1c3f58643f980a1375aa2209260b_applicationhttpadapter_impl_js_3._c_sendrequest_5(2016-09-22t17:04:18.759z/6733847e906e1c3f58643f980a1375aa2209260b/applicationhttpadapter-impl.js:121)     @ org.mozilla.javascript.gen._2016_09_22t17_04_18_759z_6733847e906e1c3f58643f980a1375aa2209260b_applicationhttpadapter_impl_js_3._c_checksignature_76(2016-09-22t17:04:18.759z/6733847e906e1c3f58643f980a1375aa2209260b/applicationhttpadapter-impl.js:1785)     @ org.mozilla.javascript.gen._2016_09_22t17_04_18_759z_6733847e906e1c3f58643f980a1375aa2209260b_applicationhttpadapter_impl_js_3.call(2016-09-22t17:04:18.759z/6733847e906e1c3f58643f980a1375aa2209260b/applicationhttpadapter-impl.js)     @ org.mozilla.javascript.contextfactory.dotopcall(contextfactory.java:394)     @ org.mozilla.javascript.scriptruntime.dotopcall(scriptruntime.java:3091)     @ org.mozilla.javascript.gen._2016_09_22t17_04_18_759z_6733847e906e1c3f58643f980a1375aa2209260b_applicationhttpadapter_impl_js_3.call(2016-09-22t17:04:18.759z/6733847e906e1c3f58643f980a1375aa2209260b/applicationhttpadapter-impl.js)     @ com.worklight.integration.js.javascriptmanager.callfunction(javascriptmanager.java:267)     @ com.worklight.integration.js.javascriptmanager.invokefunction(javascriptmanager.java:241)     @ com.worklight.integration.js.javascriptmanager.invokefunction(javascriptmanager.java:211)     @ com.worklight.integration.services.impl.adaptermanagerimpl.invokefunction(adaptermanagerimpl.java:113)     @ com.worklight.integration.js.javascriptprocedureinvoker.invoke(javascriptprocedureinvoker.java:42)     @ com.worklight.integration.model.procedureinvoker.invokeprocedure(procedureinvoker.java:54)     @ com.worklight.integration.model.procedure.invoke(procedure.java:166)     @ com.worklight.integration.services.impl.dataaccessserviceimpl.callprocedureinternal(dataaccessserviceimpl.java:775)     @ com.worklight.integration.services.impl.dataaccessserviceimpl.callprocedure(dataaccessserviceimpl.java:721)     @ com.worklight.integration.services.impl.dataaccessserviceimpl.access$200(dataaccessserviceimpl.java:74)     @ com.worklight.integration.services.impl.dataaccessserviceimpl$3.execute(dataaccessserviceimpl.java:603)     @ com.worklight.core.auth.impl.authenticationservicebean.accessresource(authenticationservicebean.java:82)     @ com.worklight.integration.services.impl.dataaccessserviceimpl.invokeprocedureinternal(dataaccessserviceimpl.java:600)     @ com.worklight.integration.services.impl.dataaccessserviceimpl.invokeprocedure(dataaccessserviceimpl.java:160)     @ com.worklight.gadgets.serving.handler.backendqueryhandler.getcontent(backendqueryhandler.java:95)     @ com.worklight.gadgets.serving.handler.backendqueryhandler.dopost(backendqueryhandler.java:56)     @ com.worklight.gadgets.serving.gadgetapiservlet.dogetorpost(gadgetapiservlet.java:178)     @ com.worklight.gadgets.serving.gadgetapiservlet.dopost(gadgetapiservlet.java:135)     @ javax.servlet.http.httpservlet.service(httpservlet.java:595)     @ com.worklight.gadgets.serving.gadgetapiservlet.service(gadgetapiservlet.java:118)     @ javax.servlet.http.httpservlet.service(httpservlet.java:668)     @ com.ibm.ws.webcontainer.servlet.servletwrapper.service(servletwrapper.java:1240)     @ com.ibm.ws.webcontainer.servlet.servletwrapper.handlerequest(servletwrapper.java:760)     @ com.ibm.ws.webcontainer.servlet.servletwrapper.handlerequest(servletwrapper.java:443)     @ com.ibm.ws.webcontainer.filter.webappfilterchain.invoketarget(webappfilterchain.java:127)     @ com.ibm.ws.webcontainer.filter.webappfilterchain.dofilter(webappfilterchain.java:88)     @ com.worklight.core.auth.impl.authenticationfilter$1.execute(authenticationfilter.java:224)     @ com.worklight.core.auth.impl.authenticationservicebean.accessresource(authenticationservicebean.java:82)     @ com.worklight.core.auth.impl.authenticationfilter.dofilter(authenticationfilter.java:229)     @ com.ibm.ws.webcontainer.filter.filterinstancewrapper.dofilter(filterinstancewrapper.java:194)     @ com.ibm.ws.webcontainer.filter.webappfilterchain.dofilter(webappfilterchain.java:85)     @ com.worklight.analytics.analyticsfilter.dofilter(analyticsfilter.java:124)     @ com.ibm.ws.webcontainer.filter.filterinstancewrapper.dofilter(filterinstancewrapper.java:194)     @ com.ibm.ws.webcontainer.filter.webappfilterchain.dofilter(webappfilterchain.java:85)     @ com.ibm.ws.webcontainer.filter.webappfiltermanager.dofilter(webappfiltermanager.java:949)     @ com.ibm.ws.webcontainer.filter.webappfiltermanager.invokefilters(webappfiltermanager.java:1029)     @ com.ibm.ws.webcontainer.servlet.cacheservletwrapper.handlerequest(cacheservletwrapper.java:78)     @ com.ibm.ws.webcontainer.webcontainer.handlerequest(webcontainer.java:885)     @ com.ibm.ws.webcontainer.osgi.dynamicvirtualhost$2.run(dynamicvirtualhost.java:252)     @ com.ibm.ws.http.dispatcher.internal.channel.httpdispatcherlink$taskwrapper.run(httpdispatcherlink.java:584)     @ com.ibm.ws.threading.internal.worker.executework(worker.java:439)     @ com.ibm.ws.threading.internal.worker.run(worker.java:421)     @ java.lang.thread.run(thread.java:745)                                   com.worklight.common.log.filters.errorfilter 

windows phone not support display of alert method. instead need come different way of displaying prompts end-user in application.

for example, use this: prompt in windows phone

navigator.notification.alert(     'you winner!',  // message     alertdismissed,         // callback     'game over',            // title     'done'                  // buttonname );  function alertdismissed() {     // } 

Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -