Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/01/2013, 08:56
imorrison
 
Fecha de Ingreso: mayo-2010
Mensajes: 12
Antigüedad: 14 años, 9 meses
Puntos: 0
Problema con respuesta de nusoap

ayuda amigos del foro

estoy consumiendo un webservices (con nusoap) de prueba el cual me entrega el tiempo segun los parametros de ciudad y pais el cual me devuelve un array.

hasta ahi todo perfecto el problema surge cuando quiero sacar solo un par de datos de este array no se como hacerlo porfavor amigos del foro necesito su ayuda les escribo el codigo para que me puedan ayudar

Código:
Error_reporting(0);
require_once('lib/nusoap.php');
 
$ciudad=$_POST["ciudad"];
$pais=$_POST["pais"]; 


$wsdl = 'http://www.webservicex.net/globalweather.asmx?wsdl';

$soapclient = new nusoap_client($wsdl,true);

$function = 'GetWeather';

$params = array('CityName' => $ciudad,'CountryName' => $pais);

$result = $soapclient->call($function , $params);
 

echo "<pre>", htmlspecialchars(print_r($result, true)), "</pre>";
y lo que imprime

Código:
Array
(
    [GetWeatherResult] => <?xml version="1.0" encoding="utf-16"?>
<CurrentWeather>
  <Location>Quintero Santiago, Chile (SCER) 32-47S 071-31W 8M</Location>
  <Time>Mar 30, 2011 - 11:00 AM EDT / 2011.03.30 1500 UTC</Time>
  <Wind> from the SW (220 degrees) at 10 MPH (9 KT) (direction variable):0</Wind>
  <Visibility> greater than 7 mile(s):0</Visibility>
  <Temperature> 75 F (24 C)</Temperature>
  <DewPoint> 57 F (14 C)</DewPoint>
  <RelativeHumidity> 53%</RelativeHumidity>
  <Pressure> 29.91 in. Hg (1013 hPa)</Pressure>
  <Status>Success</Status>
</CurrentWeather>
)