- Felipe Ocampo
- PowerBuilder
- Wednesday, 19 June 2024 07:51 PM UTC
We are currently using a service consumption with the SoapConnection object in the PB 2019 R2 release; We are going to migrate to the PB 2022 R3 version.
In version 2022 R3 it shows me the following message "The assembly 'AAAA.dll' doesn't exist."
Searching for information in the forums I saw that the code can be migrated to use the HTTPClient object, but I have problems with logging the application, since we do this in the code
//create a soap object to connect to the web service
iws_connection = CREATE SoapConnection
//configure a log file to see connection errors
ls_string ="SoapLog='c:\\soaplog.txt', userID='"+ls_user+"', Password='"+ls_password+"', Timeout=20"
ll_return = iws_connection.setoptions(ls_string);
//make the connection to the web service
ll_connection_status = iws_connection.createinstance( iws_electronicinvoicing, "nv_InstanciaProyecto", ls_endpoint) ;
In the HTTPCLIENT I have not been able to make the connection with those credentials
This is the code that I am implementing with HTTPCLIENT
httpClient lo_client
CoderObject lco_Code
integer li_ret , i , li_StatusCode
String lo_xml_request, ls_UserName, ls_Password, ls_url
string ls_data, ls_body, ls_ret, ls_Basic
ls_url="https:--------------------------------?wsdl"
ls_body = ''+&
'" '+&
''+&
' '+&
' '+&
' ?'+&
' '+&
' ?'+&
' ?'+&
' ?'+&
' ?'+&
' '+&
' '+&
' '+&
''+&
lo_client = Create httpClient
lco_Code = Create CoderObject
ls_UserName = ""
ls_Password = ""
ls_Basic = lco_code.base64encode( Blob(ls_UserName + ":" + ls_Password , EncodingUTF8!))
lo_client.SetRequestHeader( "Authorization", "Basic " + ls_Basic)
lo_client.SetRequestHeader("Content-Type", "text/xml")
lo_client.sendrequest('POST',ls_url,ls_body)
li_StatusCode = lo_client.GetResponseStatusCode()
ls_ret = lo_client.GetResponseStatusText( )
li_ret = lo_client.getresponsebody(ls_data)
destroy lo_client
Always giving me a 401 response
I hope for your help
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.