- Andres Slachevsky
- PowerBuilder
- Monday, 10 August 2020 06:07 PM UTC
Hello All,
i need to call the WS located in :
190.104.150.226:8033/MidaSoftware2/MidaSoftare
when we call MidaNovedades in SoapUi we get all the accents.
when we call it from PB we lost the characters we set the same encondigo (UTF-8) this is the code we are using :
/ Novedades MIDA
String ls_novedad, &
ls_version_n, &
ls_modulo, &
ls_texto, &
ls_pass
Integer li_i
Long ll_novedad, &
ll_modulo, &
ll_max_novedad
ll_novedad = 1
ls_request = 'MidaNovedades'
ls_soap_action = '"' + gs_mida_server + '/MidaSoftware2/MidaSoftware/' + ls_request + '"'
// Armar Request
ls_xml_request = '<?xml version="1.0" encoding="UTF-8"?>' + &
'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mid="' + gs_mida_server + '/MidaSoftware2/MidaSoftware">' + &
'<soapenv:Header/>' + &
' <soapenv:Body>' + &
' <mid:'+ls_request+'>' + &
' <mid:user>xxx</mid:user>' + &
' <mid:pass>'+ls_pass+'</mid:pass>' + &
' <mid:novedad>'+ls_novedad+'</mid:novedad>' + &
' </mid:'+ls_request+'>' + &
' </soapenv:Body>' + &
'</soapenv:Envelope>'
// Crear el objeto y asignar sus propiedades
lo_client = Create httpClient
lo_client.SetRequestHeader("Content-Type", "text/xml;charset=UTF-8")
lo_client.SetRequestHeader("SOAPAction", ls_soap_action)
lo_client.SetRequestHeader("Content-Length", String(len(ls_xml_request) ))
li_ret = lo_client.sendrequest('POST', ls_url, ls_xml_request )
If li_ret = -1 then
li_i = 20
end if
If li_ret = 1 Then
//SE VERIFICA EL STATUS DE LA RESPUESTA
li_StatusCode = lo_client.GetResponseStatusCode()
ls_ret = lo_client.GetResponseStatusText()
If li_Statuscode = 200 Then
//SI ESTA OK SE LEE EL VALOR DE LA RESPUESTA
li_ret = lo_client.getresponsebody(ls_data)
ls_version_n = f_texto_extraer(ls_data, '<@version>', '</@version>' )
ls_modulo = f_texto_extraer(ls_data, '<@modulo>', '</@modulo>' )
ls_texto = f_texto_extraer(ls_data, '<@texto>', '</@texto>' )
ll_max_novedad = Long(f_texto_extraer(ls_data, '<@max_novedad>', '</@max_novedad>'))
If ll_novedad > ll_max_novedad Then
li_i = 20
Else
If ls_version_n = '***' Then
li_i = 20
Else
ll_modulo = Long(ls_modulo)
Insert Into admin.mida_novedades (novedad, version, modulo, descripcion) Values (:ll_novedad, :ls_version_n, :ll_modulo, :ls_texto) ;
End If
End If
End If
if li_Statuscode<> 200 then
li_i = 20
end if
End If
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.