Web service ask for windows credentials (1 Viewer)

AccOUCH

Registered User.
Local time
Today, 05:06
Joined
Sep 27, 2018
Messages
25
We are coding a B2B connection from our VBA Access application to a WebService. Everything seems to run properly at the beginning but an extremely confusing message pops up in the midst of this process. Please, see attached screenshot:

The code we're using is:

Code:
oHTTP.Open "POST", "http://SERVER.com/webservices/ws? 
   incomplete&versionIn=1.6.1&versionOut=1.6.1", False
   oHTTP.setRequestHeader "Host", "http://SERVER.com/webservices/ws"
   cadena = EncodeBase64(Usuario!Usur99 & ":" & Usuario!Pawd99)
   oHTTP.setRequestHeader "Authorization", "Basic" & cadena
   oHTTP.setRequestHeader "Content-Type", "text/xml charset=UTF-8"
   oHTTP.send mipedido
   devolver = oHTTP.responseText
   mipedido = ""

Any idea on how to avoid this Windows credentials requirement?
 

Attachments

  • Mensaje.PNG
    Mensaje.PNG
    19 KB · Views: 95

isladogs

MVP / VIP
Local time
Today, 13:06
Joined
Jan 14, 2017
Messages
18,209
Perhaps its not reading the URL correctly as it seems to be split over 2 lines
Try this

Code:
Dim strURL as String 
strURL = "http://SERVER.com/webservices/ws?incomplete&versionIn=1.6.1&versionOut=1.6.1", False
oHTTP.Open "POST", strURL

If that doesn't work try
oHTTP.Open "GET", strURL

Also I normally just use oHTTP.Send or oHTTP.Send "".
I believe 'mi pedido' is Spanish for 'My Order'. What is mipedido and should it be wrapped in ""
 
Last edited:

ByteMyzer

AWF VIP
Local time
Today, 05:06
Joined
May 3, 2004
Messages
1,409
There is one code error that I can see right away.
Try changing:
Code:
oHTTP.setRequestHeader "Authorization", "Basic" & cadena
...to:
Code:
oHTTP.setRequestHeader "Authorization", "Basic " & cadena
(note the space after the word Basic)
 

Users who are viewing this thread

Top Bottom