Resolved The new OpenEdge.Net.Pl in OE 11.5

Cecil

19+ years progress programming and still learning.
Hi, have some demo code which performs a simple HTTP GET and it compiles Okay and it worked the very first time but it errors the subsequent times after that.
I get the following error messages:
"Lead attribute in a chained-attribute expression (a:b:c) must be type HANDLE or a user-defined type and valid (not UNKNOWN). (10068)" x2
"Unusable datatype for SetParameter method. (15295)"

Restart my OE session and it will work again but only once and it's very slow.

Code:
using OpenEdge.Net.URI.
using OpenEdge.Net.UriSchemeEnum.
using OpenEdge.Net.HTTP.RequestBuilder.
using OpenEdge.Net.HTTP.HttpRequest.
using OpenEdge.Net.HTTP.HttpResponse.
using OpenEdge.Net.HTTP.HttpClient.

DEFINE VARIABLE oURI        AS URI no-undo.
DEFINE VARIABLE oRequest    AS HttpRequest no-undo.
DEFINE VARIABLE oResponse   AS HttpResponse no-undo.

oURI = NEW URI(UriSchemeEnum:http, 'www.progress.com').

oRequest = RequestBuilder:Get(oURI):Request.

oResponse = HttpClient:Instance():execute(oRequest).


MESSAGE
    oResponse:StatusCode:Value skip
    oResponse:StatusCode:Name skip
    view-as alert-box.

DELETE object oResponse.
DELETE object oRequest.
DELETE object oURI.
 

Cecil

19+ years progress programming and still learning.
Oh, I am getting this code from the making_http_requests_with_openedgenet.pdf document from Peter Judge.

Also you need to modify your propath to include the $DLC/gui/netlib/OpenEdge.Net.pl
 
Last edited:

Cecil

19+ years progress programming and still learning.
WHat's the stack trace on that if you enable DEBUGALERT?

Nothing very exciting. Line 16 is:
Code:
oResponse = HttpClient:Instance():execute(oRequest).

ScreenShot142.png
Also the OpenEdge Debugger doesn't give anyway anything really useful.
ScreenShot143.png

I've also edit the code to include some extra debugging for the Debugger and I get the Error message 'Nothing to execute. (2999)'

Error 2999 occurs when starting Debugger with DEBUGGER:DEBUG() statement.

Error 2999 is generated when using any debugger commands (Step Into, Step Over, etc.)

Unable to debug code further. The debugger appears to be in an endless loop.

Debugger has to be closed in order to continue

Starting the Debugger with DEBUGGER:DEBUG()
 
Last edited:

RealHeavyDude

Well-Known Member
I use the .NET classes directly since OE 11.3 and never had any issues:
Code:
using System.*.
using System.Text.*.
using System.IO.*.
using System.Net.*.
using System.Security.Cryptography.X509Certificates.*.
using System.Security.Cryptography.*.
 
...
 
define variable requestUri  as class Uri  no-undo.
define variable request  as class HttpWebRequest  no-undo.
define variable response  as class HttpWebResponse  no-undo.
define variable responseReader  as class StreamReader  no-undo.

Maybe using them might help you. Plus, the .NET classes are very well documented.

Heavy Regards, RealHeavyDude.
 

Cecil

19+ years progress programming and still learning.
I use the .NET classes directly since OE 11.3 and never had any issues:
Code:
using System.*.
using System.Text.*.
using System.IO.*.
using System.Net.*.
using System.Security.Cryptography.X509Certificates.*.
using System.Security.Cryptography.*.

...

define variable requestUri  as class Uri  no-undo.
define variable request  as class HttpWebRequest  no-undo.
define variable response  as class HttpWebResponse  no-undo.
define variable responseReader  as class StreamReader  no-undo.

Maybe using them might help you. Plus, the .NET classes are very well documented.

Heavy Regards, RealHeavyDude.

Ah... Yes, but will it work on Linux?
 

RealHeavyDude

Well-Known Member
Sorry did not take that into account. The reason why I went for the .NET classes in the first place was that I needed to fetch the SSL client certificate from the Windoze certificate store and the support for SSL client certificates was not there in OE11.3. So you see it is strictly a Windozw client use case.

I need to have a deeper look at the implementation in OE11.5 though as we might need to use it on Solaris by the end of the year too. As of yet we struggle to get the upgrade to OE11 as the outsourced sourcing ( vendor management ) and Progress have a different understanding of our license usage. Therefore I can't say much intelligent at this point.

Heavy Regards, RealHeavydude.
 

Cecil

19+ years progress programming and still learning.
Since Service Pack 1 has now been released for OE 11.5 it's now official, the ABL now supports HTTP requests (finally).

Here is sample sample code which does a basic get request. It took me sometime the for where the actual request appears. the output is written to files in your session temp folder.

Code:
USING OpenEdge.Net.HTTP.IHttpRequest.
USING OpenEdge.Net.HTTP.IHttpResponse.
USING OpenEdge.Net.HTTP.RequestBuilder.
USING OpenEdge.Net.HTTP.ClientBuilder.

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.com".
                            
oRequest = RequestBuilder:Get(httpUrl):Request.

oResponse = ClientBuilder:Build():Client:Execute(oRequest).

MESSAGE
    oResponse:StatusCode
    oResponse:StatusReason
    view-as alert-box info.

The result from using the OpenEdge.Net.HTTP classes is that it generates three files:
  • body.txt
  • request-raw.txt
  • response-data-received.txt
Unfortunately it's not exactly fast and the documentation could be updated to clearly identify each of the classes methods and properties.
 
Top