I'm struggling to put the syntax together in order to make an HTTP request from behind our proxy server. Internal requests are fine, but when adding the ViaProxy option I get the errors below.
I'm missing something in the construction of the code, but can't figure our what. Any help/advice please?
DEFINE VARIABLE oRequest AS IhttpRequest NO-UNDO.
DEFINE VARIABLE oResponse AS IhttpResponse NO-UNDO.
DEFINE VARIABLE httpUrl AS CHARACTER NO-UNDO.
httpUrl = "http://www.google.co.uk".
oRequest = RequestBuilder:Get(httpUrl):Request.
oResponse = ClientBuilder:Build():ViaProxy('myproxy:8080'):Client:Execute(oRequest).
view-as alert-box info.
The error message:
Lead attributes in a chained-attribute expression (a:b:c) must be type HANDLE or
a user-defined type and valid (not UNKNOWN). (10068)
DYNAMIC-NEW cannot instantiate class OpenEdge.Net.HTTP.ProxyHttpClient because
the wrong number of parameters were passed to the constructor, or the constructor was not PUBLIC. (14758)
Ignore the <a> tags in the code.....the editor plugin has put them in.
Thanks for the detailed info Peter I'm still playing with this and getting the error after waiting a few seconds (maybe 30) for the request to complete:
Connection failure for host www.bbc.co.uk port 80 transport TCP.
oRequest = RequestBuilder:Get(httpUrl):ViaProxy('http://myproxy:8080'):Request.
oResponse = ClientBuilder:Build():Client:Execute(oRequest).
You mentioned adding the scheme ('http') to the proxy URI........do I need to add something else here?
Finally - where would I add the missing constructor if I was to update the OE code?
I know the proxy server is accepting requests as I've tested with wget -e http_proxy=myproxy:8080
Thanks for your help Peter.
I'll go the hotfix route and let you know how it goes.
Anyone can detail the steps needed to patch the OpenEdge 11.5.1 in order to have the "ViaProxy()" method working and also the problem with the wrong host?
Thanks and regards,
Hi Claudiu, we reverted back to 4gl sockets and a mixture of wget/curl via os-command. Also some .net implementations that acted as a wrapper around a 3rd party web service. We ended up going down this route as we had issues with SSL certs on TLS 1.1/1.2.
You're best bet is to get the hot-fix, or upgrade to 11.7 if possible.