soap y dato de retorno
Posted: Mon Oct 09, 2017 1:15 am
Estimados, tengo un problema
Esta web, me permite recuperar el tipo de cambio del dia, y del mes.
usando soap, con vfp, ambos funcionan de perlas, pero con harbour, solo puedo recuperar el del dia.
https://servicios.bcn.gob.ni/Tc_Servicio/ServicioTC.asmx
el del mes, no lo puedo recuperara, parece que ese metodo retorna un xml con los datos, y el ole de harbour no lo reconoce.
algien que me pueda echar una mano.
Esta web, me permite recuperar el tipo de cambio del dia, y del mes.
usando soap, con vfp, ambos funcionan de perlas, pero con harbour, solo puedo recuperar el del dia.
https://servicios.bcn.gob.ni/Tc_Servicio/ServicioTC.asmx
el del mes, no lo puedo recuperara, parece que ese metodo retorna un xml con los datos, y el ole de harbour no lo reconoce.
algien que me pueda echar una mano.
- Code: Select all Expand view
LOCAL oSoap
LOCAL aTableTC := {}, nValue
LOCAL dDateIni, dDateEnd
dDateIni := DMY2DATE( 1, nMonth, nYear )
dDateEnd := EoM( dDateIni )
WaitOn( "Recuperando tipo de cambio del mes de " + CMonth( dDateIni ) + " del año " + HB_NToS( nYear ) )
CursorWait()
IF ( oSoap := win_oleCreateObject( "MSSOAP.SoapClient30" ) ) != NIL
oSoap:MSSoapInit( "https://servicios.bcn.gob.ni/Tc_Servicio/ServicioTC.asmx?WSDL" )
FOR x := dDateIni TO dDateEnd
nValue := oSoap:RecuperaTC_Dia( nYear, nMonth, Day( x ) )
IF nValue > 0
AAdd( aTableTC, { x, nValue } )
ENDIF
NEXT
ELSE
MsgAlert( "Error: SOAP Toolkit 3.0 not available." + FINL + win_oleErrorText() )
ENDIF
WaitOff()
oSoap := NIL
hb_gcAll( TRUE )
RETURN aTableTC
#pragma BEGINDUMP
/*definición de constante necesaria para compilador XCC*/
#ifdef __XCC__
#define WINVER 5
#endif
/*llamada a encabezados de api de xharbour y windows SDK*/
#include "hbapi.h"
#include "hbapiitm.h"
#include "hbapierr.h"
#include "hbdate.h"
#include "shlobj.h"
#include "windows.h"
HB_FUNC( DMY2DATE )
{
int iDay = hb_parni( 1 );
int iMonth = hb_parni( 2 );
int iYear = hb_parni( 3 );
hb_retd( iYear, iMonth, iDay );
}
#pragma ENDDUMP