Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/11/2010, 21:25
geran88
 
Fecha de Ingreso: junio-2008
Mensajes: 29
Antigüedad: 15 años, 10 meses
Puntos: 1
traer datos de un webservice a flex

Buenas tengo un problema y es que no se como traer datos provistos de un webservice y ponerlos en dos textinput.un nombre y un apellido, realice el webservice en .net. el cual al probarlo me da como resultado algo como esto:
Código PHP:
  <?xml version="1.0" encoding="utf-8" ?> 
- <ArrayOfUsuario xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
- <usuario>
  <nombre>juan</nombre> 
  <apellido>perez</apellido> 
  </usuario>
  </ArrayOfUsuario>
entonces necesito saber como obtengo el nombre y el apellido y los pongo ambos en textinputs diferentes.

hasta ahora en flex tengo eso:

Código PHP:
<s:WebService id="guardar" wsdl="http://localhost:52773/Biblioteca/Service.asmx?WSDL" >  
            
            <
mx:operation name "bus" result "buscarUresul(event);" fault="error(event);">
                </
mx:operation>    
        </
s:WebService>


public function 
buscarUresul(event:ResultEvent):void
        
{   
            var 
respuesta:String event.target.lastResult.toString();
            var 
xmlres:XML = new XML(respuesta);
            
             
            
nombre.text =xmlres.table[0].Rows ("nombre");
            
apellido.text=xmlres.table[0].Rows ("apellido");
        }
        public function 
error(event:FaultEvent):void
        
{  
            
Alert.show("fault""fault"Alert.OK);           
                
        } 

espero me puedan colaborar