web services - webservice in mobile application as3 -
i have problem application mobile devices, when test app in pc webservice conection ok, answer. when test application in mobile devices, first use of application takes long answer server , screen stays in "sending..." , after many attemps , resets of application, conection ok , after that, application works fine. problem? pd: dont speak english well.
the code is:
private function panicstart(e:mouseevent = null):void { trace("han presionado el boton de panico"); //alert.show(_canvas, "datos de usuario :" + "\nnombre: " + _currentname + "\nkey: " + _currentkey + "\nd.n.i. :" + _currentdni + "\nmóvil: " + _currentphone + "\n\ndatos de geoposición:\n" + "\latitud: " + _latitud + "\nlongitud: " + _longitud + "\n ", "envío de datos", new array("ok"), null); var url:string = "http://appmovil.munijesusmaria.gob.pe/1380panico/ws_panico.asmx?wsdl"; webservice = new webservice(); webservice.loadwsdl(url); webservice.addeventlistener(loadevent.load, buildservicerequest); _state = state_startsend } function buildservicerequest(evt:loadevent) { _state = state_sending; serviceoperation = webservice.getoperation("insertar"); trace("esperando respuesta"); serviceoperation.addeventlistener(faultevent.fault, displayerror); serviceoperation.addeventlistener(resultevent.result, displayresult); if (_panicscreen.txtreference.text == _textreference || _panicscreen.txtreference.text == "") serviceoperation.send(_currentdni, _currentname, _currentphone, _latitud.tostring(), _longitud.tostring(), "ninguna", "285df565h5654cc"); else serviceoperation.send(_currentdni, _currentname, _currentphone, _latitud.tostring(), _longitud.tostring(), _panicscreen.txtreference.text, "285df565h5654cc"); } function sentgotopanic(e:mouseevent = null):void { screenmanager.gotoscreen("panic"); _state = state_sent; } function displayerror(evt:faultevent) { _state = state_justsent; sentgotopanic(); alert.show(_canvas, "error al enviar los datos" + "\n ", "alerta", new array("ok"), new array("ok"), null); trace("error"); _panicscreen.txtreference.text = ""; _state = state_sent; } function displayresult(evt:resultevent) { _state = state_justsent; trace("eeeeeeexito") var result:string = evt.result string; sentgotopanic(); alert.show(_canvas, "datos enviados" + "\n ", "alerta", new array("ok"), null); trace("error"); _panicscreen.txtreference.text = ""; _state = state_sent; }
Comments
Post a Comment