我的移动设备应用程序有问题,当我在我的电脑上测试应用程序时,网络服务连接正常,我得到了答案。但是,当我在移动设备中测试应用程序时,第一次使用应用程序需要很长时间才能从服务器获得答案,并且屏幕停留在“正在发送...”,经过多次尝试和重置应用程序后,连接没关系,之后,应用程序工作正常。什么可能是我的问题?pd:我英语说得不太好。
代码是:
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 as String;
sentgotoPanic();
Alert.show(_canvas, "Datos Enviados" + "\n ", "Alerta", new Array("ok"), null);
trace("error");
_panicScreen.txtReference.text = "";
_state = STATE_SENT;
}