The release of Service Pack 1 for OpenEdge 11.5 now includes

Posted by jamesbowen on 22-May-2015 03:29

Now that we can make HTTP request from the ABL (without any .NET, sockets etc). Can somebody show an ABL example of how to consume OData from the DataDirect Cloud.

There are some documentation available in the Release Notes for OE 11.5.1 but nothing in the official documentation yet. 

All Replies

Posted by Peter Judge on 22-May-2015 07:40

> There are some documentation available in the Release Notes for OE 11.5.1 but nothing in the official documentation yet.  Also It's a little

Formal doc will be added in the next major release.

> bit slow as I believe it wait a few seconds to determine if there is any more additional information on the socket connection. 

That shouldn't be a problem any more. It was in the 11.5 'tech preview' but has been remedied in 11.5.1. If you still see it happening, log a bug, please.
 
-- peter
 
 
[collapse]
From: jamesbowen [mailto:bounce-jamesbowen@community.progress.com]
Sent: Friday, 22 May, 2015 04:31
To: TU.OE.Development@community.progress.com
Subject: [Technical Users - OE Development] The release of Service Pack 1 for OpenEdge 11.5 now includes HTTP request capabilities, YAY!!
 
Thread created by jamesbowen

Now we can make HTTP request from the ABL (without any .NET, sockets etc). Can somebody show an ABL example of how to consume OData from the DataDirect Cloud.

There are some documentation available in the Release Notes for OE 11.5.1 but nothing in the official documentation yet.  Also It's a little bit slow as I believe it wait a few seconds to determine if there is any more additional information on the socket connection. 

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by CMI on 25-May-2015 18:13

I was about raise a support case and I was in the process of testing my sample code which was breaking down the timings and I realized that the temp folder was located on a network share. This seams to be the cause of the performance issues I was experiencing.

Side Note: I've noticed that the files created in the temp folder are not of a unique name. Could this cause a problem if you had multiple processes/threads using the HTTP Client at exactly the same time when there is a shared temp folder?

Posted by Peter Judge on 26-May-2015 07:57

[quote user="CMI"]

I was about raise a support case and I was in the process of testing my sample code which was breaking down the timings and I realized that the temp folder was located on a network share. This seams to be the cause of the performance issues I was experiencing.

[/quote]

Interesting. Given that the temp/debug files are only written when -debugalert is set, do you see the slower runs when debug is off?

[quote user="CMI"]

Side Note: I've noticed that the files created in the temp folder are not of a unique name. Could this cause a problem if you had multiple processes/threads using the HTTP Client at exactly the same time when there is a shared temp folder?

[/quote]

Good question.

The single name debug file was because those files are mainly intended for developer debugging (so a single name makes things easier. for me anyway :) ).

The HTTP client doesn't keep the stream/output open - it just writes in append-mode when needed. That said, it is certainly possible to have multiple clients write to the same files simultaneously, especially if you're using a shared network drive for -T or you're on an AppServer. Feel free to log a bug to make the names unique.

Posted by CMI on 27-May-2015 16:12

Yes indeed, I did have -debugalert enabled since this was my development environment and that would explain the debug files. So that would be expectable having static names.

So I guess this actually raises another point, how do you actual get the message payload/body from the server response?

Looking at the available documentation (ref: Table 7: Extracting typed data from a response) it's not clear to me how oEntity object is assigned a value from oResponce. How does oResponce even know about oEntity object?

Update:

I think I've just answered my own question. I think that the oEntity needs to be supplied as a second parameter for the RequestBuilder:Get() method?

 

Posted by Peter Judge on 28-May-2015 07:50

When the client receives a response from the server, it populates the IHttpResponse object with a status code & reason, headers, cookies and the payload, which is represented by the Entity property.
 
The client attempts to make sure that the Entity contains an appropriately-typed object: so if the response's Content-Type header is application/json, it will create a JsonObject; if the Content-Type is html, it will create a String object.  There's a mapping in the RequestWriterBuilder class, in case you're interested.
 
SO to get the response you can just say something like
oMessageBody = cast(oResponse:Entity, JsonObjbect).
 
assuming that you know its JSON.
 
Hth,
-- peter
 
 
[collapse]
From: CMI [mailto:bounce-CMI@community.progress.com]
Sent: Wednesday, 27 May, 2015 17:14
To: TU.OE.Development@community.progress.com
Subject: RE: [Technical Users - OE Development] The release of Service Pack 1 for OpenEdge 11.5 now includes HTTP request capabilities, YAY!!
 
Reply by CMI

Yes indeed I did have -debugalert enabled (since this was my development environment) that would explain the debug files. So that would be expectable having static names.

So I guess this actually raises another point, how do you actual get the message payload/body from the server response?

Looking at the available documentation (ref: Table 7: Extracting typed data from a response) it's not clear to me how oEntity object is assigned a value from oResponce. How does oResponce even know about oEntity object?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

This thread is closed