1. Felipe Ocampo
  2. PowerBuilder
  3. Wednesday, 19 June 2024 19: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

Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 19 June 2024 21:24 PM UTC
  2. PowerBuilder
  3. # 1

Try without the EncodingUTF8!

Comment
  1. Felipe Ocampo
  2. Thursday, 20 June 2024 12:47 PM UTC
I performed the test in the following way and it still gives me the same problem



lo_client = Create httpClient

lco_Code = Create CoderObject



ls_UserName = ""

ls_Password = ""



ls_Basic = lco_code.base64encode( Blob(ls_UserName + ":" + ls_Password ))

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



In SOAPUI I consume the services and the structure is as follows in the log

<soapenv:login>

<soapenv:username>ZZZZZZZ</soapenv:username>

<soapenv:password>ZZZZZZ</soapenv:password>

<soapenv:authType>No Authorization</soapenv:authType>

</soapenv:login>



I hope for your help
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 20 June 2024 13:27 PM UTC
  2. PowerBuilder
  3. # 2

I would use a tool that can trace what the older working version is sending and compare that with what the newer non-working version is sending.

Comment
  1. Felipe Ocampo
  2. Monday, 24 June 2024 16:00 PM UTC
It is correct, but when consuming the service it generates the initial error, The assembly 'AAAA.dll' doesn't exist.



The code I currently have is with the soapconnection object

//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_ProjectInstance", ls_endpoint) ;



//Consume the webservice by calling the ZZZZ function with the defined parameters

lstr_response = iws_electronicinvoicing.ZZZZ ( Arg1, Arg2, Arg3, Arg4)



Here the instance of the object is made, but the nv_InstanciaProyecto object was created with WebService Proxy (already obsolete) and when using the services it generates the original error, for this reason we are trying to migrate the code to the new HTTPCLIENT object
  1. Helpful
  1. Roland Smith
  2. Monday, 24 June 2024 16:38 PM UTC
Is AAAA.dll the real name? It would be easier to help if we knew the real name of the assembly. The .PBX has a hard link to EASYSOAP.DLL and EXPAT190.DLL so you will need those. There might be other PB 2019 runtime files that it refers to, pbNetWSRuntime190.dll for example.
  1. Helpful
  1. Felipe Ocampo
  2. Tuesday, 25 June 2024 13:30 PM UTC
The name of the dll is InvoicingElectronicavpService.dll, this object is created when the WebService Proxy is executed and the AssemblyName is created in the WSDL engine .NET.
  1. Helpful
There are no comments made yet.
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Tuesday, 25 June 2024 14:04 PM UTC
  2. PowerBuilder
  3. # 3

Hi

When we converted a SOAP Call to HTTP our message looked something like this:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV = "http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns ="http://www.opentravel.org/OTA/2003/05" xmlns:add ="http://schemas.xmlsoap.org/ws/2004/08/addressing"><SOAP-ENV:Header><wsse:Security xmlns:wsse ="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"  SOAP-ENV:mustUnderstand = "1"><wsse:UsernameToken><wsse:Username>abc123</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">somepw</wsse:Password></wsse:UsernameToken></wsse:Security> </SOAP-ENV:Header>    <SOAP-ENV:Body><ns:OTA_PingRQ  EchoToken= "uuid:0134D8F1-0249FA-3E7-04D2-00989681" TimeStamp = "2024-06-25T15:00:11+01:00" Version = "1.001"><ns:EchoData>Hello World</ns:EchoData></ns:OTA_PingRQ></SOAP-ENV:Body></SOAP-ENV:Envelope>

 

I guess you obscured the details from your Post, but thought I would share this.

 

Hope it helps.

Comment
  1. Felipe Ocampo
  2. Friday, 28 June 2024 15:00 PM UTC
The connection with the service could already be established but the response we got is 415, with the tool offered by WebService Proxy it was done correctly, but now for the change to HTTPClient we have not been able to implement it. It should be noted that with WebService Proxy it works correctly
  1. Helpful
  1. David Peace (Powersoft)
  2. Friday, 28 June 2024 15:07 PM UTC
I'm suggesting that if you use Fiddler to see what the original HTTP message was and compare that to your message now and see what the difference is. That was how I was able to get al te extra code about schem,a etc that were needed to support the web service call.
  1. Helpful 1
  1. Felipe Ocampo
  2. Friday, 28 June 2024 16:51 PM UTC
I was able to make the connection and get a response from the service, thank you very much
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.