-
Mario Francisco Celleri
- PowerBuilder
- Tuesday, 9 September 2025 03:02 PM UTC
Hi guys.
We have an server with more than one network interface.
One of then have internet conection; all of then no internet access.
We need to probe we have internet conection to use and access to a web services and bring data.
How can we choose the right network interface; to conect to internet and the comunication stablishes?
Now we tried to connect, but error -21 receive when http request is call.
At then moment we tried with this example code.
integer li_rc, li_estadoApi
string ls_string
HttpClient lnv_HttpClient
lnv_HttpClient = Create HttpClient
li_rc = lnv_HttpClient.SendRequest("GET", "https://demo.appeon.com/PB/webapi_client/employee/102")
IF li_rc = 1 THEN
li_estadoApi = lnv_HttpClient.GetResponseStatusCode()
IF li_estadoApi = 200 THEN
lnv_HttpClient.GetResponseBody(ls_string)
ELSE
// ls_error = f_error_respuesta_api(li_estadoApi)
// gs_error_api = ls_error
MessageBox("!! Respuesta WebService !!", "Error " + string(li_estadoApi) +" - " + ls_error)
// lbo_rucEncontrado = FALSE
END IF
ELSE
// ls_errorDeConeccion = f_error_api(li_rc)
// gs_error_api = ls_errorDeConeccion
MessageBox("!! Error de Conexión !!", ls_error)
// lbo_rucEncontrado = FALSE
END IF
DESTROY lnv_HttpClient
Any ideas?
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.