Description

Deploy a new REST service in a web application deployed in an ABL application.

HTTP Operation

POST

URI

host_name:port/oemanager/applications/ABL_app_name/webapps
/Web_app_name/transports/rest/oeservices/

Content-Type

application/vnd.progress.paar+zip

Content disposition

attachment; filename={ AppNewService.paar | AppNewService.zip }

Response codes

200 Success
500 Unexpected Server Error 

Command-line example

curl -X POST -u username:password -v  
http://localhost:16680/oemanager/applications/oepas1/webapps/ROOT/transports/rest/oeservices
--data-binary @RESTService.paar
-H "Accept: application/vnd.progress+json"
-H "Content-Type:application/vnd.progress.paar+zip" 
-H "Content-Disposition: attachment; filename=RESTService.paar" 

ABL HTTP client example

DEFINE VARIABLE oPaar AS CLASS Memptr NO-UNDO.
DEFINE VARIABLE mMyMemPtr AS MEMPTR NO-UNDO.
DEFINE VARIABLE resp AS OpenEdge.Net.HTTP.IHttpResponse.

FILE-INFO:FILE-NAME = "C:\OpenEdge\WRK\RESTService.paar".
SET-SIZE(mMyMemPtr) = FILE-INFO:FILE-SIZE.

INPUT FROM VALUE(FILE-INFO:FILE-NAME) BINARY NO-MAP NO-CONVERT.
IMPORT mMyMemPtr.
INPUT CLOSE.

oPaar = new Memptr(mMyMemPtr).

resp = OpenEdge.Net.HTTP.ClientBuilder:Build():Client
   :Execute(OpenEdge.Net.HTTP.RequestBuilder
      :Post('http://localhost:16680/oemanager/applications/oepas1/webapps/ROOT/transports/rest/oeservices')
      :WithData(oPaar)
      :AcceptContentType('application/vnd.progress+json')
      :AddHeader('Content-Disposition', 'attachment; filename="RESTService.paar"')
      :ContentType('application/vnd.progress.paar+zip')
      :UsingBasicAuthentication(new OpenEdge.Net.HTTP.Credentials('PASOE Manager Application', 'username', 'password'))
      :Request
   ).
 
SET-SIZE(mMyMemPtr) = 0.

Request body example

application/vnd.progress.paar+zip

Response body example

{
   "operation":"DEPLOY REST TRANSPORT DESCRIPTOR",
   "outcome":"SUCCESS",
   "result":{
      "OERestServiceDesc":[
         {
            "name":"RESTService",
            "version":"v12.1.0 ( 2019-08-07 )",
            "uri":"",
            "securedUri":"",
            "description":"PAS OpenEdge REST Service Descriptor",
            "type":"OPENEDGE",
            "archiveLocation":"WEB-INF\/adapters\/rest\/RESTService\/RESTService.paar",
            "accessUrl":"\/rest\/RESTService",
            "archiveName":"RESTService.paar",
            "oetype":"REST_DESCRIPTOR"
         }
      ]
   },
   "errmsg":"",
   "versionStr":"v12.1.0 ( 2019-08-07 )",
   "versionNo":1
}