Files

32 lines
1.1 KiB
Plaintext

IMPORT util
TYPE t_sync_cmd RECORD
oper STRING,
data STRING
END RECORD
FUNCTION conexion()
DEFINE purl,cmd,res, msg STRING,
ret INT
DEFINE r_cmd t_sync_cmd
# LET purl="https://ws.marmotech.com.do/gas/ws/r/restserver"
# LET purl="http://181.36.230.171/gas/ws/r/restserver"
LET purl="http://192.168.40.9/gas/ws/r/restserver"
# LET purl="http://200.88.67.188:2089/gas/ws/r/restserver"
# LET purl="https://ws.marmotech.com.do/gas/ws/r/restserver"
LET r_cmd.oper = "get_status"
LET r_cmd.data = util.JSON.stringify(' ') -- aca se convierte a string los datos de la operacion
LET cmd = util.JSON.stringify(r_cmd) -- aca se convierte a string el comando/operacion a enviar al server
CALL sync_send_command(purl, cmd) RETURNING ret, res
IF ret ==0 THEN
RETURN purl
ELSE
LET msg=SFMT(%"Connection '%1' failed",r_cmd.oper),"\n URL:",purl,"\n",res
CALL show_sync_err(msg)
LET purl='0'
END IF
RETURN purl
END FUNCTION