1 Attachment(s)
How to set Pre-emptive Authorization using Client Web Service
Hi everyone!
I'm trying to consume a Web Service that uses Pre-emptive Authorizarion.
I'm setting psUserName and psPassword, but I always get the error "AUTHENTICATION: USER NOT AUTHORIZED".
I tried to add a httpHeader using this link as reference: [URL]https://social.msdn.microsoft.com/Forums/vstudio/en-US/1309f72a-5e95-47b9-89bf-60211a8a63e6/how-to-set-preemptive-authorization-when-using-service-reference-with-c[/URL]
My code:
[CODE]Get Create U_cXmlDomDocument to hoXmlGet CreateDocumentElement of hoXml "Nodes" to hoRoot
Get AddElement of hoRoot "Authorization" ("Basic" * Base64EncodeString(psUserName(hConsultaWS) + ": " + psPassword(hConsultaWS)) to hoNode
Send AddSoapHeaderNode of hConsultaWS hoNode
Send Destroy of hoNode
Send Destroy of hoRoot
Get wsMETODO_SERVICO_WS of hConsultaWS vtDADOS to vtSAIDAS
Send Destroy of hConsultaWSProtheus[/CODE]
Same error...
Using SoapUI 5.6.0 I could consume the Web Service, setting the Auth parameter as the image in attachment.
Any ideas?
Regards,
Ivan Kaupa
1 Attachment(s)
Re: How to set Pre-emptive Authorization using Client Web Service
Re: How to set Pre-emptive Authorization using Client Web Service