Rest Services with Classic Appserver (OE 11.5)

Posted by SteveSaltDanwood on 08-Jun-2016 04:45

Hi all,

Our environment: OE 11.5.1 Enterprise DB running on Linux 64 bit, with Classic Appserver, and OE Dev Studio 11.5 running on Win 10 64 Bit.

From the the outset, I have little (no) experience with ReST, other than a quick play around in my Dev env, and watching some of the educational videos on YouTube.

We don't have PASOE as part of our toolset, but I've seen on a video that you can create the WAR file for the Classic Appserver. What I've been asked is whether it is possible for us to create/expose a ReST service for our customers (including authentication), but also for us to access 3rd party ReST services directly (specifically, those provided by ServiceNow )?

If this is possible, is there any documentation on how to achieve this, including testing/deploying to the Classic Appserver?

Regards,

Steve Salt

Application Developer

Posted by Ricardo Perdigao on 08-Jun-2016 10:47

Hi Steve,

I strongly suggest that you upgrade your Windows PDSOE to 11.6 SP2 before you even start. With that said:

On this workshop/video below, I show you step-by-step how to configure and expose things as REST on OE 11.5:

community.progress.com/.../2568.a-sexy-ui-for-progress-openedge-using-jsdo-oe-mobile-template-and-kendo-ui-with-sorting-filtering-and-paging

It does use the "Pacific Appserver", but all you need to do is select the traditional Appserver when creating the project.  You would select Restmgr1 and Restbroker1  instead of Oepas1 during the project creation wizard.  All other steps (with the exception that now you have to start 2 processes instead of just one) should be the same.

Please give a try and let me know if you can move forward,

Regards,

Ricardo Perdigao

All Replies

Posted by Peter Judge on 08-Jun-2016 07:52

What I've been asked is whether it is possible for us to create/expose a ReST service for our customers (including authentication), but also for us to access 3rd party ReST services directly (specifically, those provided by ServiceNow )?

There was a version of an HTTP client shipped with 11.5.1, in the $DLC/tty/netlib/OpenEdge.Net.pl library. Don't let the 'Net' part phase you and add it to propath.
 
You can now make calls to HTTP-based services quite easily from ABL.
 
I did an intro talk at PUG Challenge last year – see slides at pugchallenge.eu/.../The_world_is_your_oyster.pdf - that have some examples of use .
 
 
 

Posted by Donicello Lampe on 08-Jun-2016 08:22

You may also be interested in the following tutorials for the basics on how to create your own REST Service:

community.progress.com/.../45513

www.youtube.com/watch

I would recommend that you post your specific questions regarding authentication once you have the basics covered.

Posted by Donicello Lampe on 08-Jun-2016 08:25

Oh and for the client side, on top of what Peter already provided please take a look at the following tutorial:

www.youtube.com/watch

Posted by SteveSaltDanwood on 08-Jun-2016 10:16

I had seen this 2nd video, because about 3 minutes in they discuss the URI:Path = '/oemanager/applications/oepas1/properties/' - which led me down the "Its Pacific Appserver again"

I'm listening to the PUG Challenge 2014 audio at the moment.

We have Appserver licensing, but we don't actively use it , we inherited it in V10 when our WebSpeed licences converted over. I will try to get into Exploder to see what I can configure.

Steve

Posted by Ricardo Perdigao on 08-Jun-2016 10:47

Hi Steve,

I strongly suggest that you upgrade your Windows PDSOE to 11.6 SP2 before you even start. With that said:

On this workshop/video below, I show you step-by-step how to configure and expose things as REST on OE 11.5:

community.progress.com/.../2568.a-sexy-ui-for-progress-openedge-using-jsdo-oe-mobile-template-and-kendo-ui-with-sorting-filtering-and-paging

It does use the "Pacific Appserver", but all you need to do is select the traditional Appserver when creating the project.  You would select Restmgr1 and Restbroker1  instead of Oepas1 during the project creation wizard.  All other steps (with the exception that now you have to start 2 processes instead of just one) should be the same.

Please give a try and let me know if you can move forward,

Regards,

Ricardo Perdigao

Posted by SteveSaltDanwood on 08-Jun-2016 10:56

Richardo,

I will do - I'm not at work tomorrow, but I will have a play on Friday - point noted about 11.6.2 - that is on our radar to migrate to in the very near future.

Regards,

Steve

Posted by Peter Judge on 08-Jun-2016 12:00

Don't get hung up on the PASOE URI - you can call any HTTP or HTTPS uri. From that talk, some sample code for getting to a 'card shuffle' website.

def var oClient as IHttpClient.
def var oRequest as IHttpRequest.
def var oResponse as IHttpResponse.
def var oURI as URI.
def var oBody as JsonObject.

oClient = ClientBuilder:Build():Client.

oURI = new URI(string(UriSchemeEnum:http), 'cardshuffle.net').
oURI:Path = 'shuffle'.
oURI:AddQuery('players', string(4)).
oURI:AddQuery('handSize', string(5)).
oURI:AddQuery('numDecks', string(1)).

oRequest = RequestBuilder:Get(oURI)
                :AcceptJson()
                :Request.

oResponse = oClient:Execute(oRequest).

Posted by SteveSaltDanwood on 10-Jun-2016 03:10

Peter,

you are right, I've got the 2 conflicting approaches buzzing round in my head. We've got some HTTP calls already configured and calling on Azure ESB services that route through FUSE/Camel, but we had a defect case raised with Progress (and they are currently producing a fix), as sometimes these requests appear to go into an infinite loop, and stop processing.

One of our considerations for integration was via our Fuse ESB, and we consume the request in Progress, and post back into ServiceNow in the same way. But I thought this to be an overly complicated solution, and could have done by creating a REST service ... which led me down the "how do I do this without PASOE?"

A simple polling service using the ClientBuilder might suffice.

Regards,

Steve

This thread is closed