APSV and REST transports for a Project.

Posted by OctavioOlguin on 17-Jun-2017 14:59

Greetings.

I'm about to migrate code from classic APPServer, into PASOE.

So I tought I could consolidate 2 projects that came from 11.5.  One is for ABL remote clients and also local clients, the other is for angular 2.0 clients, so it uses rest.

My question is how would it be possible to consolidate source code in one project as there are several routines duplicated,  such project should have both facets?

Any light on the subject would be very appreciated.

Posted by Peter Judge on 20-Jun-2017 11:16

Yes.
 
There are a few things to consider
- the URI you want to expose
- how the HTTP message elements (header values, body etc) map to and from the .P’s parameters
 
You can use the REST mapper to this. The doc for this is at  documentation.progress.com/.../introducing-openedge-rest.html  but be aware that the tooling UI change significantly in 11.6 (and I’m not sure which version you’re on). Note that in 11.6+ you should use the “ABL Service” wizard to create REST services for ABL on PASOE.
 
 
 
 
 

All Replies

Posted by OctavioOlguin on 20-Jun-2017 10:09

My question is about if one project, defined as rest, could serve for ABL clients asking routines, the same routine that it serves for rest clients...

Where could I find such handbook? or info related to that?

Thanks

Posted by Peter Judge on 20-Jun-2017 10:22

Short answer is yes.
 
You will still need to figure out the PROPATH issues (duplicate code) you mentioned earlier.

Posted by OctavioOlguin on 20-Jun-2017 10:25

but I want to have only one project with code for both kind of clients....

Posted by Peter Judge on 20-Jun-2017 10:48

You can (that’s what  I thought I said).

Posted by OctavioOlguin on 20-Jun-2017 11:05

Perhaps I haven't figured out yet....

For instance, I got a procedure GetCustomers.p.  can I use it at the same time as a source for rest, and call it with RUN GetCustomers.p on hServer..... ?

Posted by Peter Judge on 20-Jun-2017 11:16

Yes.
 
There are a few things to consider
- the URI you want to expose
- how the HTTP message elements (header values, body etc) map to and from the .P’s parameters
 
You can use the REST mapper to this. The doc for this is at  documentation.progress.com/.../introducing-openedge-rest.html  but be aware that the tooling UI change significantly in 11.6 (and I’m not sure which version you’re on). Note that in 11.6+ you should use the “ABL Service” wizard to create REST services for ABL on PASOE.
 
 
 
 

Posted by onnodehaan on 20-Jun-2017 11:45

Hi Octavio,

We do this al the time.

We have API's that contain business logic.

We have SOAP-routines that convert Soap-message to APi

We have REST-routines that convert Rest-messaeg to API

We have UI-routines that convert ui-input to API

We have Import-routines that convert import files to API

We have unit-tests that test our API

Posted by OctavioOlguin on 20-Jun-2017 13:55

Could you share or explain the definition of one parameter in a .p or .cls that has the business logic, and how it would be exposed on rest? and that such conversion, how do you accomplish it?

Thanks!!!

Posted by onnodehaan on 26-Jun-2017 14:10

Hi Octavia

We have centralized API's.

For example

customerapi.p

This api contains all the business logic for CRUD-operations on customers.  The API uses a temp-table or dataset to hold the business entity.

In order to expose that API to a REST-service, we have created something like "restservice.cls". That class contains wrappers that transform the REST-message (JSON) to temp-tables. We've created generic wrapper code.

In order to expose the API to SOAP, we have created wrappers that convert the soap-message to our temp-tables/dataset.

Same for import/export.

This thread is closed