Execute Function
This section describes how to execute a JDE BSFN/NER using the function request web service.
The following are required:
- Your application must have obtained a session ID. If not, review the User Sessions topic before continuing with this section.
- The call you are making has already been defined using the Cantara Console. See Managing Functions, for more details.
A function can be executed by calling the service below with a payload that follows the Function Request definition (at a minimum the payload requires a function name and parameter). If the execution is successful, Cantara returns a response that follows the Function Response definition. If there is a failure, Cantara returns an error. See the Error Messages topic for more information.
Each function request requires one or more parameters based on their definition on the Cantara server (see Managing Functions). Although there multiple parameters defined for functions, only the parameters marked as Required need to included in the payload.
Service Definition: Execute Function
Endpoint: http://hostname:port/cantara/service/function/environment
Request-Method: POST
Note:
Environment refers to the Cantara Access Server environment you are trying to log into. For example, E1DEV. You would have previously configured this when you set up your environment. Refer to the Managing Environments topic for more details.
You can obtain a list of configured environments by using the console to Managing Environments.
To review information about how to obtain the definition for a function, see the Obtaining Request Definitions topic.
Example Executing a Function - GetAddressAlphaName
In this example the N0500160 (GetAlphaNameFromAB) is called by passing a payload that contains the address book number of the user you want to retrieve.
Before building our payload, you must view the required parameters for the function. For the GetAddressAlphaName example the required parameter is the addressNo, as shown below:
Once you have this information, you can then call and execute the function service.
Endpoint: http://hostname:port/cantara/serivce/function/environment
Request-Method: POST
Content-Type: application/json
Request Payload
{
"Parameter": [
{
"value": "1234",
"name": "addressNo"
}
],
"name": "GetAddressAlphaName"
}
Request Response
{
"Parameter": [
{
"value": "Long, Ben",
"name": "alphaName"
}
],
"Message": {
"value": "Transaction Successful",
"type": 0,
"sessionId": "608.1396755468.2"
},
"name": "GetAddressAlphaName"
}