APSV and REST transports for a Project. - Forum - OpenEdge Development - Progress Community

APSV and REST transports for a Project.

 Forum

APSV and REST transports for a Project.

This question is answered

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.

Verified Answer
  • 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
  • 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

  • Short answer is yes.
     
    You will still need to figure out the PROPATH issues (duplicate code) you mentioned earlier.
  • but I want to have only one project with code for both kind of clients....

  • You can (that’s what  I thought I said).
  • 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..... ?

  • 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.
     
     
     
     
  • 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

  • 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!!!

  • 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.