Type
|
Name
|
When to use
|
Use for both requests and responses?
|
none
|
Leave the name property blank or use null.
|
When the ABL parameter is an input type and there is no corresponding element in the HTTP request to map it to. Specifying none prompts the DOH to send an empty parameter to the ABL class method or ABL procedure.
When the ABL parameter is of an output type and you do not want to produce an HTTP message element from it.
|
Requests and Responses
|
path
|
Specify the name of the path parameter as defined in the WEB transport properties
|
When the ABL parameter is an input type and its value needs to be extracted from a parameter in the requested URL path. For example, assume that a client application makes a GET request to http://localhost:8810/myapp/web/ CustomerOrderService/customers/123 to retrieve customers records by customer ID (123).
To set this up, set path as the msgElem type and customerID as the msgElem name. Edit the PAS for OpenEdge instance's openedge.properties file and add a handler for the path parameter in the web application's WEB transport properties section (that has a title similar to oepas1.myapp.WEB). Here is an example of the handler property to add: handler2= OpenEdge.Web.DataObject.DataObjectHandler: /customers/{customerID}
|
Requests only
|
query
|
Specify the name of the query parameter
|
When the ABL parameter is an input type and its value needs to be extracted from a query in the requested URL path. For example, assume that a client application makes a GET request to http://localhost:8810/myapp/web/ CustomerOrderService?id=123 to retrieve customers records by customer ID (123).
To set this up, set query as the msgElem type and id as the msgElem name.
|
Requests only
|
queryMap
|
Leave the name property blank or use null
|
When the ABL parameter is an input type and the requested URL path contains a query of the type
OpenEdge.Core.Collections.IStringStringMap. This is mostly useful for debugging.
|
Requests only
|
header
|
The name of the HTTP header. For complex headers with parameters, use the syntax <headername>; <parameter>
|
When the ABL parameter is an input, output, or input-output type, and its value needs to be either retrieved from an HTTP request header (for input operations) or passed on to an HTTP response header (for output operations).
|
Requests and responses
|
headerSet
|
Leave the name property blank or use null
|
When the ABL parameter is an input, output, or input-output type and its value is an array of HTTP header objects. This is mostly useful for debugging.
|
Requests and responses
|
field
|
The name of a root-level key in a JSON or multipart message
|
When the ABL parameter is an input, output, or input-output type, and the value needs to be retrieved from or passed on to a JSON or multi-part message in an HTTP request or response. You can only retrieve or pass the value of a key that is at the topmost level in the message hierarchy. For example, in the following JSON message, you can only retrieve the value of message, status, date, or customer. If you need to access a 'child' element (such as text, target, id, or name in this example), you must do so from within your ABL code.
{
"message": { "text": "Order number 213 was delivered." "target": "239888" }, "status": "sent", "date": "10-APRIL-2018", "customer": { "id": "1282", "name": "John Jones" } } |
Requests and responses
|
cookie
|
Specify the name of the browser cookie
|
When the ABL parameter is an input, output, or input-output type, and its value needs to be retrieved from or passed on to a single-value browser cookie.
|
Requests and responses
|
statusCode
|
Leave the name property blank or use null
|
When the ABL parameter is an output type, and the its value needs to be passed to the client application as an HTTP status code. Note that this overrides the statusCode property set for the HTTP verb.
|
Responses only
|
body
|
Leave the name property blank or use null
|
When the ABL parameter is an input, output, or input-output type, and you need to either retrieve its value from the message body of the HTTP request or pass on the value from the ABL parameter to the message body of the HTTP response. While retrieving the value for an INPUT parameter, you can set a flag to strip the envelope from the HTTP request message. Similarly, in the case of an OUTPUT parameter, you can optionally set a flag to add the envelope to the parameter output before forming the HTTP response. To set these flags, add a an options property under the HTTP verb in the mapping file as shown in this example:
"/getPersonalizedMessage": {
"GET": { "contentType": "application/json", "options": { "writeBI": true, "requestEnvelope" :true "responseEnvelope" :true "errorEnvelope" :true }, |
Requests and responses
|
request
|
Leave the name property blank or use null
|
When the ABL parameter is an input type, and you want to populate its value with the complete HTTP request message, including the headers, body, etc.
|
Requests only
|
httpMethod
|
Specify the name of the HTTP verb
|
When you want to perform some type of debugging by passing the HTTP method name (GET, PUT, POST, etc) to an ABL method via an INPUT parameter.
|
Requests only
|
constant
|
Specify the value that you want to pass on to the ABL parameter
|
When you want to populate the value of an input parameter with the value of the name property. This is mostly useful for testing.
|
Requests only
|
"services": {
"HelloService": { .... .... "schemas": { "dsCustomer" : { "ttCustomer": { "trackChanges": true, "indexes" : { "Comments": { "primary": false, "unique": false, "word": false, "fields": ["Comments"] }, "CountryPost": { "primary": false, "unique": false, "word": false, "fields": ["Country", "PostalCode"] }, "CustNum": { "primary": true, "unique": true, "word": false, "fields": ["CustNum"] }, "Name": { "primary": false, "unique": false, "word": false, "fields": ["Name"] }, "SalesRep": { "primary": false, "unique": false, "word": false, "fields": ["SalesRep"] } }, "fields": [ {"name": "CustNum", "ablType": "INTEGER ", "extent": null}, {"name": "Country", "ablType": "CHARACTER", "extent": null}, {"name": "Name", "ablType": "CHARACTER", "extent": null}, {"name": "Address", "ablType": "CHARACTER", "extent": null}, {"name": "Address2", "ablType": "CHARACTER", "extent": null}, {"name": "City", "ablType": "CHARACTER", "extent": null}, {"name": "State", "ablType": "CHARACTER", "extent": null}, {"name": "PostalCode", "ablType": "CHARACTER", "extent": null}, {"name": "Contact", "ablType": "CHARACTER", "extent": null}, {"name": "Phone", "ablType": "CHARACTER", "extent": null}, {"name": "SalesRep", "ablType": "CHARACTER", "extent": null}, {"name": "CreditLimit", "ablType": "DECIMAL ", "extent": null}, {"name": "Balance", "ablType": "DECIMAL ", "extent": null}, {"name": "Terms", "ablType": "CHARACTER", "extent": null}, {"name": "Discount", "ablType": "INTEGER ", "extent": null}, {"name": "Comments", "ablType": "CHARACTER", "extent": null}, {"name": "Fax", "ablType": "CHARACTER", "extent": null}, {"name": "EmailAddress", "ablType": "CHARACTER", "extent": null} ] } } } } } |