Making Rest calls from ABL

Posted by Gareth Payne on 30-Jan-2015 05:13

@[OpenEdge]: Hi,
Customer wants to consume rest services from unix client.
I know rest call will be implemented in 11.5.1 but I customer needs to implement rest call now- on OE11.3.1.
Has anyone written any code to consume rest calls - if so - please could you share.

If not, my thoughts on implementing rest calls are to write some java - rest libraries included - and call the java code via abl input through command.
Does anyone have any better solutions.
A colleague  - Chris Skeldon  - suggested  - Can they use the ABL socket command or shell out to an external app, such as curl or a Node script? 

Kind Regards

Gareth

All Replies

Posted by egarcia on 30-Jan-2015 06:16

Hello Gareth,

I think that you have mentioned all the possible best approaches for doing REST in OpenEdge 11.3.1.

The selection between a cURL, a Node.js script and a Java program would depend on your requirements.

Are the REST services RESTful? Do they need any particular format for the requests?

How is authentication handled?

cURL seems straight forward, you can invoke the command from ABL and just process the data that is returned.

You can also use Node.js as command line tool with the advantage of having JavaScript to do additional processing of the data.

Using command line with input-output through is also simple to handle text based/XML/JSON data.

The ABL socket command approach would be useful if calling cURL or a Node.js script has limitations, for example the performance is not acceptable.

For the ABL socket command approach, you could use Node.js as a proxy to call the REST services buy you would need to define a protocol on how the ABL program would call the the Node.js server and process the data.

Notice that this would be basically ABL sockets calling a service provided via Node.js.

The difference with calling the actual REST service would be that perhaps, using ABL sockets you would need to write code to handle authentication which you can simplify by either using cURL or calling a Node.js server where you control the protocol.

I hope this helps.

Posted by Gareth Payne on 30-Jan-2015 10:41

Hi,
 
Many Thanks, lots of potential solutions to digest.
 
Kinds Reagrds
Gaareth
 
[collapse]
From: egarcia [mailto:bounce-egarcia@community.progress.com]
Sent: 30 January 2015 12:17
To: TU.OE.General@community.progress.com
Subject: RE: [Technical Users - OE General] Making Rest calls from ABL
 
Reply by egarcia

Hello Gareth,

I think that you have mentioned all the possible best approaches for doing REST in OpenEdge 11.3.1.

The selection between a cURL, a Node.js script and a Java program would depend on your requirements.

Are the REST services RESTful? Do they need any particular format for the requests?

How is authentication handled?

cURL seems straight forward, you can invoke the command from ABL and just process the data that is returned.

You can also use Node.js as command line tool with the advantage of having JavaScript to do additional processing of the data.

Using command line with input-output through is also simple to handle text based/XML/JSON data.

The ABL socket command approach would be useful if calling cURL or a Node.js script has limitations, for example the performance is not acceptable.

For the ABL socket command approach, you could use Node.js as a proxy to call the REST services buy you would need to define a protocol on how the ABL program would call the the Node.js server and process the data.

Notice that this would be basically ABL sockets calling a service provided via Node.js.

The difference with calling the actual REST service would be that perhaps, using ABL sockets you would need to write code to handle authentication which you can simplify by either using cURL or calling a Node.js server where you control the protocol.

I hope this helps.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

This thread is closed