Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 26 FEB 2009 06:39:56AM Martin Drenovac wrote:

I have a working piece of HTTP code, which we now have to extend to set a "proxy" param. I have tried everything to call the method correctly, but cannot get past the errors:

Below is the line of code that I need to work, and as you can see from VB example code as well as the extract from VB object viewer I think it's working fine. However always get the same error "Unknown Name":

x=OleCallMethod(oHttp, "setProxy",2,socket)

and here's the code which works other than the new one liner (above) that I'm trying to introduce.

oHttp=OleCreateInstance('MSXML2.SERVERXMLHTTP')

	status =oleStatus()
	if status then
		estateE=OleGetProperty(oHttp,'readyState')
		estatus=OleGetProperty(oHttp,'status')
		estext =OleGetProperty(oHttp,'statusText')
		debug
		call msg(@window,'Error in OleCreateInstance of SERVERXMLHTTP: ':status)
		return 0
	end
  • * x=oHttp-]Open(method, url, sync$)
	x=OleCallMethod(oHttp,"Open", method, url, sync$)
	status=oleStatus()
	if status then
		estateE=OleGetProperty(oHttp,'readyState')
		estatus=OleGetProperty(oHttp,'status')
		estext =OleGetProperty(oHttp,'statusText')
		debug
		call msg(@window,'Error in Open: ':status)
		return 0
	end
  • * If you use a proxy server you must configure it
  • *
	/*
		Sub setProxy(proxySetting As SXH_PROXY_SETTING, varProxyServer, varBypassList)
	    Member of MSXML2.ServerXMLHTTP
		Specify proxy configuration
	 */
	IP=10.30.5.7'
	PORT=8080
	socket=ip:":":port
  • * x=oHttp-]SetProxy(2,(socket));
  • * x=OleCallMethod(oHttp, "getOption",2,socket) ;* returns 147352562 (8002000E) Invalid number of parameters.
  • * x=OleCallMethod(oHttp, "getOption",2) ;* returns x=13056, status=0
  • * x=OleCallMethod(oHttp, "getOption",-1) ;* 147024809 (80070057) One or more arguments are invalid.
  • * OlePutProperty(oHttp, "setProxy", socket) ;* 2147352570 (80020006) Unknown name
  • * x=OleCallMethod(oHttp, "setProxy",2,socket) ;* 2147352570 (80020006) Unknown name
	status=oleStatus()
	debug
	if status then
		estateE=OleGetProperty(oHttp,'readyState')
		estatus=OleGetProperty(oHttp,'status')
		estext =OleGetProperty(oHttp,'statusText')
		debug
		call msg(@window,'OLE setProxy failed with error: ':status)
		return 0
	end

At 26 FEB 2009 08:19AM Bob Carten wrote:

Martin,

Your script is using 'MSXML2.SERVERXMLHTTP', which will invoke version 2 of the ServerXmlHttp Object. From what I have read, use MSXML2.SERVERXMLHTTP.3.0 or better yet 'MSXML2.SERVERXMLHTTP.6.0'. Do not use 'MSXML2.SERVERXMLHTTP.4.0', or 'MSXML2.SERVERXMLHTTP.5.0'.

So … the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. Five is right out. Six is best


At 26 FEB 2009 08:30AM Martin Drenovac wrote:

Bob - you're a "damned" legend (this is in fact a compliment in Oz)..

Thank you very much - status() of 0

- will check it in production and drop you a confirmation note.

Cheers Bob


At 26 FEB 2009 12:32PM DSig wrote:

You made me laugh .. thanks


At 26 FEB 2009 11:34PM Martin Drenovac wrote:

Bob - works perfectly. Thank you again.

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/f2412b765fc029dd85257569004014da.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1