Ver Mensaje Individual
  #5 (permalink)  
Antiguo 10/10/2011, 11:37
Avatar de Omegakenshin
Omegakenshin
 
Fecha de Ingreso: junio-2010
Ubicación: Costa Rica
Mensajes: 156
Antigüedad: 13 años, 10 meses
Puntos: 22
Exclamación Código listo para usarse

Muchisimas gracias Andres :D realmente aprecio mucho tu ayuda, al final termine con este código, por akeyo de k alguien más lo necesite, salu2

Código PHP:
<?php
//Obtener tipo de cambio
$doc_c = new DOMDocument();
$doc_v = new DOMDocument();
$ind_econom_ws =  'http://indicadoreseconomicos.bccr.fi.cr/indicadoreseconomicos/WebServices/wsIndicadoresEconomicos.asmx/ObtenerIndicadoresEconomicos';
$fecha date("d/m/Y");
$compra 317;
$venta 318;

$urlWS_c $ind_econom_ws."?tcIndicador=".$compra."&tcFechaInicio=".$fecha."&tcFechaFinal=".$fecha."&tcNombre=tq&tnSubNiveles=N";
$urlWS_v $ind_econom_ws."?tcIndicador=".$venta."&tcFechaInicio=".$fecha."&tcFechaFinal=".$fecha."&tcNombre=tq&tnSubNiveles=N";

//Valor Compra
$xml_c file_get_contents($urlWS_c);
$doc_c->loadXML($xml_c);
$ind_c $doc_c->getElementsByTagName('INGC011_CAT_INDICADORECONOMIC')->item(0);
$val_c $ind_c->getElementsByTagName('NUM_VALOR')->item(0);
$valor_compra substr($val_c->nodeValue,0,-6);

//Valor Venta
$xml_v file_get_contents($urlWS_v);
$doc_v->loadXML($xml_v);
$ind_v $doc_v->getElementsByTagName('INGC011_CAT_INDICADORECONOMIC')->item(0);
$val_v $ind_v->getElementsByTagName('NUM_VALOR')->item(0);
$valor_venta substr($val_v->nodeValue,0,-6);


//Mostrar Valores
echo 'Valor compra: ' $valor_compra;
echo 
'<br/>Valor venta: ' $valor_venta;
?>