Presentation is loading. Please wait.

Presentation is loading. Please wait.

Defining JDE APIs Using the AIS server

Similar presentations


Presentation on theme: "Defining JDE APIs Using the AIS server"— Presentation transcript:

1 Defining JDE APIs Using the AIS server
Steven Armstrong - Wenjun Bai -

2 El Paso County, Colorado, was founded in 1861 with a current population of about 663,000.
Situated at the base of ft Pikes Peak, surrounds Colorado Springs Employees 2800 workers Introduction to the County, the environment and our history with managed services.

3 About this session This is more of a hack session
It is 100% developer nerd speak We aren’t experts – but we got the basics down It’s not about how to code a third party application but how to format the REST JSON We don’t discuss how to cross your network firewall We don’t discuss the code for parsing the call Shave some hours off your journey Avoid some of the pitfalls.

4 AIS Technology Application Interface Services Server
Another server installed on Web Logic similar to JDE Web server Turn any JDE application into a web service interface using JSON REST calls A lot of potential – we are exploring using the technology for mobile apps

5 AIS Architecture

6 Project Objectives To allow a third party cloud solution integration to JDE to create work order. To add attachments to the work order. To add notes to the work order. To update the status of the work order in their system.

7 Project Vendor created the java application to make the JSON calls.
We defined the web service API calls for the work orders. They coded a Java application that lived in the DMZ to communicate between the applications.

8 Lessons Learned Timing matters
Open the token – do the work – close the token Don’t try to maintain open tokens Watch the number of sessions their code is producing on server manager. If they are not handling the token correctly they will fill the server and crash it. No outbound calls from the AIS server

9 SoapUI – Essential Tool
The ability to make a Json call to the AIS server and see the response Test and confirm the AIS code was working

10 Technique SoapUI Create a call to get the token
Create a call for each of the functions you want to perform Create a call for the token close. Each time run the function to get the token and then copy and paste the token into the different calls.

11 Set up a REST Project File -> New REST project
Enter the IP address for AIS server and also the port:

12 Configure the Project Method: POST
Resource: /jderest/tokenrequest for token, /jderest/formservice for working with JDE form The REST message is in the box with Media Type of “application/json”

13 List of Endpoint Uniform Resource Identifier (URI)
Enter the Endpoint URI in the resource field on SoapUI. These define what will be returned by the AIS server. Endpoint URI Method Description of Service /tokenrequest POST Get token and user information /tokenrequest/ POST Release the token logout /formservice POST Response will contain a JSON representation of the form requested /batchformservice POST Response will contain a JSON representation of forms requested. /file/gettext POST Response will contain the text for the first text media object. /file/updatetext POST Response will contain the status of the text update. /file/list POST Response will contain list of MO for the structure /key requested. /file/upload POST Response will contain details of uploaded file, including sequence /file/download POST Response will contain multi-partform including data for attachment. /file/addurl POST Response will contain the details of the URL MO ,including URL text and sequence. /file/delete POST Response indicates the success or failure to delete the MO for the sequence Refer to this guide: JDEdwards Enterprise One Application Interface Services Server Reference Guide Tools Release 9.2

14 Get Address Records

15 Get Token

16 Request in SOAPUI

17 Token Request to Close Token
Resource needs to be: /jderest/tokenrequest/logout The message is just the token: {"token": "044rfi5NiRpBGKGKypZbd6/rv4BEsi4NHjsXYGnN4ScLs0=MDE5MDA2MTAwNzU2MDMyNTg5NDIzMzQxNlNvYXBVSTE0OTkzNTUzMzQ4NDE="}

18 Get Address Number Info JSON Request (1)
{ "environment": "JDV920", "role": "*ALL", "deviceName": "SoapUI", "token": "044K2Kj6t79cyKF2UQGNE+nx9vMGaij+MjTfBRuC8PvqTQ=MDE5MDA2NDM2OTE 1NTYwOTc1ODY3MDAzNFNvYXBVSTE0OTg0OTYxMjc5Mzc=", "formName": "P01012_W01012B", "version": "ZJDE0001", "formsServiceAction":"R", // “R”: retrieval, “U”: add/update "maxPageSize": "2000", // max number of records returned "returnControlIDs": "1[19,20]|62", // return grid column controlID 19 (an8) and 20 (alph); // return form control 62 (display phone) "formInputs": // this is form interconnect [ { "value": "E", // address book type "id": "2“ // control id in form data structure } ],

19 Get Addresss Number Info JSON Request (2)
"formActions": [{ "value": ">510000", // address number > "command": "SetQBEValue", "controlID": "1[19]“ // grid column control id 19 }, { "value": "on", // check box Display Phone "command": "SetCheckboxValue", "controlID": "62“ // controlId for Display Phone "command": "DoAction", // click button FIND "controlID": "15" }] }

20 formInputs from Form Data Structure

21 Control ID for grid: 1

22 Control ID for Address Number: 19

23 ControlID for Alpha Name: 20

24 ControlID for Display Phone: 62

25 ControlID for FIND Button: 15

26 Get Address Number Info JSON Request (1)
{ "environment": "JDV920", "role": "*ALL", "deviceName": "SoapUI", "token": "044K2Kj6t79cyKF2UQGNE+nx9vMGaij+MjTfBRuC8PvqTQ=MDE5MDA2NDM2OTE 1NTYwOTc1ODY3MDAzNFNvYXBVSTE0OTg0OTYxMjc5Mzc=", "formName": "P01012_W01012B", "version": "ZJDE0001", "formsServiceAction":"R", // “R”: retrieval, “U”: add/update "maxPageSize": "2000", // max number of records returned "returnControlIDs": "1[19,20]|62", // return grid column controlID 19 (an8) and 20 (alph); // return form control 62 (display phone) "formInputs": // this is form interconnect [ { "value": "E", // address book type "id": "2“ // control id in form data structure } ],

27 Get Addresss Number Info JSON Request (2)
"formActions": [{ "value": ">510000", // address number > "command": "SetQBEValue", "controlID": "1[19]“ // grid column control id 19 }, { "value": "on", // check box Display Phone "command": "SetCheckboxValue", "controlID": "62“ // controlId for Display Phone "command": "DoAction", // click button FIND "controlID": "15" }] }

28 Part of JSON Response "rowIndex": 0, "MOExist": false,
"mnAddressNumber_19":{ "id": 19, // returned AN8 controlID "internalValue": , "dataType": 9, "bsvw": true, "title": "Address Number", "visible": true, "longName": "mnAddressNumber_19", "editable": false, "value": "512943“ // returned value }, "sAlphaName_20":{ "id": 20, // returned ALPH controlID "internalValue": "DOCKUM, ROGER R", "dataType": 2, "title": "Alpha Name", "longName": "sAlphaName_20", "value": "DOCKUM, ROGER R“ // returned value

29 DEMO

30 Create Work Order

31 Create WO JSON Request (1)
“formName": "P17714_W17714A", "version": "ZDSV0001", "formsServiceAction":"U", "returnControlIDs": "235", // return previous order number "formActions": [{ "value": "WO", // doc type "command": "SetControlValue", "controlID": "20" },{ "value": "I", // work order type "controlID": "26" "value": "ISV", // department code "controlID": "116" }, { "value": "1", // priority "controlID": "150" },

32 Create WO JSON Request (2)
{ "value": "Created from soupui 3", // description "command": "SetControlValue", "controlID": "152" },{ "value": "Issue Description from // issue description SoapUI", "controlID": "47" "value": " 11551", // branch plant "controlID": "43" "value": " 11551", // account business unit "controlID": "199" }, ******** "command": "DoAction", // OK button "controlID": "11" } ] }},

33 Create WO JSON Response

34 ControlID for Previous Order Number : 235

35 ControlID for Order Type: 20

36 ControlID for Type: 26

37 ControlID for OK Button: 11

38 Work Order in JDE

39 DEMO

40 Attach Text to Work Order

41 Attach Text to WO JSON Request
"environment":"JDV920", "role":"*ALL", "deviceName":"SoapUI", "token": "044iG5j+m3Z990hBAA6UClch+zU1sSQHxw1zAOG0zzd3eM=MDE4MDA2NDMwMTI3NTQzMzYwMzQwNzY1U29hcFVJMTQ5OTI4OTMxNjY2NQ==", "formName":"P48201_W48201F", "version":"ZDSV0001”, "moStructure":"GT4801A”,// GT data structure name "moKey":[ "400109“ // key (work order number) ], "inputText":"\nFirstLine \nSecondLine AIS test // input text, ‘\n’ for char return \nThirdLine AIS\nFourthLine AIS\nFifthline AIS\n", "appendText":true // append to existing text attachment }

42 Attach Text to WO

43 Text Attachment in JDE

44 Attach a Media Object

45 Upload File Attachment
Select multipart/form-data for media type Attachment tab, set two files JSON file needs to have moAdd on contentID Attached file needs to have file on contentID

46 JSON Request for Uploading
{ "environment":"JDV920", "role":"*ALL", "file":{ "fileName":"JDE Tech.pdf", // file name on local drive "itemName":"JDE Tech PDF From SoapUI" }, // item name in JDE attachment "moStructure":"GT4801A", // GT structure name "formName":"P48201_W48201F", "deviceName":"SoapUI", "version":"ZDSV0001", "moKey":["400109"], // key, work order number "token": "044liH7JF9IRnTP8TL7fxnPzp5dHInxNUjj3dD0V3Hxt1Q=MDE5MDA2NDE0NDA3NDQ0OTI2ODcwMDExM1NvYXBVSTE0OTg1MDkzODY1Nzc=" }

47 File Attached in JDE

48 DEMO

49 Download Media Object

50 Download Attachment from JDE
Can only get back octet stream on SoapUI

51 Can Use CURL to Download
CURL is a tool to transfer data from or to a server, using one of the supported protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or FILE).  We can have the JSON request message in a text file like downloadMO.txt We run the CURL from command line, which specify where to put the downloaded attachment and what name it has, and some other features

52 DownloadMO.txt { "environment":"JDV920", "role":"*ALL", "deviceName":"SoapUI", "token": "044rfi5NiRpBGKGKypZbd6/rv4BEsi4NHjsXYGnN4ScLs0=MDE5MDA2MTAwNzU2MDMyNTg5NDIzMzQxNlNvYXBVSTE0OTkzNTUzMzQ4NDE=", "moStructure": "GT4801A", // GT strucure "moKey": [ "400109“ // work order number ], "formName": "P48201_W48201F", "version": "ZDSV0001", "sequence": 1 // attachment sequence number }

53 Command Line curl -i -X POST -H "Content-Type:application/json" > c:\temp\jdeMO_ pdf

54 Downloaded File

55 DEMO

56 Resources JD Edwards EnterpriseOne Application Interface Services Client Java API Developer's Guide Release 9.2 E JD EdwardsEnterpriseOne Application Interface Services Server Reference Guide Tools Release 9.2 E REST API

57


Download ppt "Defining JDE APIs Using the AIS server"

Similar presentations


Ads by Google