Discussion:
converting a code piece to WinHTTPRequest 5.1
(too old to reply)
Munish
2006-03-14 20:51:26 UTC
Permalink
Hi

I am working on a piece of code that had been written using the
MSXML.ServerXMLHTTP.4.0. I need to change this to use the
WinHTTP.WinHTTPRequest.5.1. This code is in VB

original code:
110 Set conn = CreateObject("WinHTTP.WinHTTPRequest.5.1")

270 conn.setProxy 2, m_sProxyServer, ""

'set proxy credentials
280 conn.setProxyCredentials m_sProxyUser, m_sProxyPassword
290 conn.open "GET", sURL, False, m_sAuthName, m_sAuthPassword

300 conn.send objXMLSend

340 Set objXMLReceive = conn.responseXML

New Code:
110 Set conn = CreateObject("WinHTTP.WinHTTPRequest.5.1")

330 conn.setProxy 2, m_sProxyServer, ""
'set proxy credentials

Const HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 1
Const HTTPREQUEST_SETCREDENTIALS_FOR_PROXY = 1

350 conn.open "GET", sURL, False

360 conn.SetCredentials m_sProxyUser, m_sProxyPassword,
HTTPREQUEST_SETCREDENTIALS_FOR_PROXY

380 conn.send objXMLSend


I need to pass on the login credentials for the website like how it was done
earlier using the m_sAuthNAme and m_sAuthPassowrd variables. The information
available in these variables is different than the proxy credentials.

Thanks
Scherbina Vladimir
2006-03-15 13:16:41 UTC
Permalink
Munish,

I guess you should ask this on winhttp NG: microsoft.public.winhttp
--
Vladimir
http://spaces.msn.com/vladimir-scherbina/
Post by Munish
Hi
I am working on a piece of code that had been written using the
MSXML.ServerXMLHTTP.4.0. I need to change this to use the
WinHTTP.WinHTTPRequest.5.1. This code is in VB
110 Set conn = CreateObject("WinHTTP.WinHTTPRequest.5.1")
270 conn.setProxy 2, m_sProxyServer, ""
'set proxy credentials
280 conn.setProxyCredentials m_sProxyUser, m_sProxyPassword
290 conn.open "GET", sURL, False, m_sAuthName, m_sAuthPassword
300 conn.send objXMLSend
340 Set objXMLReceive = conn.responseXML
110 Set conn = CreateObject("WinHTTP.WinHTTPRequest.5.1")
330 conn.setProxy 2, m_sProxyServer, ""
'set proxy credentials
Const HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 1
Const HTTPREQUEST_SETCREDENTIALS_FOR_PROXY = 1
350 conn.open "GET", sURL, False
360 conn.SetCredentials m_sProxyUser, m_sProxyPassword,
HTTPREQUEST_SETCREDENTIALS_FOR_PROXY
380 conn.send objXMLSend
I need to pass on the login credentials for the website like how it was done
earlier using the m_sAuthNAme and m_sAuthPassowrd variables. The information
available in these variables is different than the proxy credentials.
Thanks
Munish
2006-03-15 14:11:27 UTC
Permalink
Thanks a lot for the information Vladimir.

Munish
Post by Scherbina Vladimir
Munish,
I guess you should ask this on winhttp NG: microsoft.public.winhttp
--
Vladimir
http://spaces.msn.com/vladimir-scherbina/
Post by Munish
Hi
I am working on a piece of code that had been written using the
MSXML.ServerXMLHTTP.4.0. I need to change this to use the
WinHTTP.WinHTTPRequest.5.1. This code is in VB
110 Set conn = CreateObject("WinHTTP.WinHTTPRequest.5.1")
270 conn.setProxy 2, m_sProxyServer, ""
'set proxy credentials
280 conn.setProxyCredentials m_sProxyUser, m_sProxyPassword
290 conn.open "GET", sURL, False, m_sAuthName, m_sAuthPassword
300 conn.send objXMLSend
340 Set objXMLReceive = conn.responseXML
110 Set conn = CreateObject("WinHTTP.WinHTTPRequest.5.1")
330 conn.setProxy 2, m_sProxyServer, ""
'set proxy credentials
Const HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 1
Const HTTPREQUEST_SETCREDENTIALS_FOR_PROXY = 1
350 conn.open "GET", sURL, False
360 conn.SetCredentials m_sProxyUser, m_sProxyPassword,
HTTPREQUEST_SETCREDENTIALS_FOR_PROXY
380 conn.send objXMLSend
I need to pass on the login credentials for the website like how it was done
earlier using the m_sAuthNAme and m_sAuthPassowrd variables. The information
available in these variables is different than the proxy credentials.
Thanks
Loading...