hello all
I am using the httpclient object to consume a soap ws .
the vendor told me I need to apply a user name before I calling the ws.
How do I do that ?
using the SetRequestHeader function ? something like SetReqesutHeader( "user name", "my user name") ?
But , how do I know the what to send as the first parameter to the function ? "user-name" , UserName ...
Doe's the vendor should provide that ?
Thanks
Moshe
What is CoderObject
I tried the code and the app got error on that line
Thanks
Its a new object class added to PB2017 (and higher) that allows your PB App's to Encode & Decode datum. Have a look in the PB2017R3 Help file under the same name for more details.
Note: This new class is not yet supported by PowerServer 2019.
Regards ... Chris
That is my code :
if IsValid(lnv_HttpClient ) then
Try
lo_coder = CREATE CoderObject
ls_header = "Basic "
ls_id = G_user_name + ":" + G_user_password
Messagebox("ls_id=",ls_id)
lblb_id = Blob (ls_id , EncodingANSI!)
ls_id = String (lo_coder.Base64Encode ( lblb_id) )
ls_header += ls_id
Messagebox("ls_header=", ls_header)
lnv_HttpClient.SetRequestHeader("Authorization", ls_header)
Is_HttpToSend = "http://...... "
ls_json = ''
ret = lnv_HttpClient.SendRequest("POST", Is_HttpToSend, ls_json)
Messagebox("lnv_HttpClient.GetResponseStatusCode()=",lnv_HttpClient.GetResponseStatustext())
and I still getting error 401 - UnAuthorized ….
is something missing ?
When I print the var Is_header on screen its after decoding so I see something else from what the server is about to get
Thanks