Results 1 to 3 of 3

Thread: How to set Pre-emptive Authorization using Client Web Service

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    São Paulo / Brazil
    Posts
    467

    Default 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: https://social.msdn.microsoft.com/Fo...ference-with-c

    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
    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
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	WebServiceImage.jpg 
Views:	36 
Size:	31.8 KB 
ID:	14015  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •