In this tutorial you will use LANSA Integrator Studio to create a new JSON binding solution to read a JSON request in the form that you created in the tutorial JSM020 – Receive and write JSON.

  1. In the LANSA Integrator Studio window, make sure the GetTutordJSON project window is open.  Right-click on Solutions and select New Solution from the popup menu. From the Tool dropdown select JSON Binding Wizard. In Solution Group and solution file type RequestTutordJSON. Click Yes to create solution group dialog box.
  2. From the JSON Type Selection dialog box select TutordRequestJSON.
  3. Select the Configuration tab and change the Package to au.com.RequestTutordJSON.service.json.

    NB: It is good practice to make the Package name unique to other projects. If later you were also to create a new solution also called au.com.RequestTutordJSON.service.json then this would overwrite your other instances using this package (name).
  4. Select the Mapping tab and right click BatchNumber. From the pop-up select Field. You will notice that a default of BATCHNUMBER is appended. Right click and select Edit from the drop down. Change this to the field DXBINDF0A.
  5. Repeat for OrderNumber and call this field DXBINDF0B.

    NB: You have 26 available fields called DXBINDF0A, B, C…. DXBINDF0Z. You will use these field names later on when creating the JSM Binding Scripts.
  6. When the field mapping is complete, build the project.  From the Project menu select Build or click the equivalent tool button.

    When complete you will get the following message:
  7. Click Ctrl-S to Save and then Alt-F4 to Exit
  8. Back in the LANSA Integrator Studio window, expand the RequestTutordJSON solution, then right-click on the RequestTutordJSON.json.jar file and select Send To / Integrator Folder from the popup menu.
  9. Repeat the previous step for the JSONFileBindService.properties file.
  10. In the LANSA Integrator Studio window,.expand the Servers item near the bottom of the tree and double-click the server definition corresponding to your LANSA Composer server.  This will open a view of the server in the right-hand window pane, allowing you to deploy the completed RequestTutordJSON solution from your PC to the server.
  11. Expand the Integrator item in the tree on the left-hand side, then expand the bindings folder and locate the RequestTutordJSON.json.jar file.  Right-click the file and select Publish File from the popup menu.  Click Yes when prompted to confirm the request.
  12. Expand the properties folder and locate the JSONBindFileService.properties file.  Right-click the file and select Publish Section from the popup menu.  Click Yes when prompted to confirm the request.
  13. 13. Finally, you need to restart LANSA Integrator on your server in order to use the new solution.  Before you do so, be sure (especially in a production environment) that no jobs are using the LANSA Composer or LANSA Integrator server.  Restarting LANSA Integrator will interrupt running jobs that are using it.

    When you are ready to restart LANSA Integrator, select the server Instance in the right-hand pane, right-click and select Shutdown / Reboot from the popup menu.  Click Yes when prompted to confirm the request.

Now continue with the following step:

     JSM023 - Create a JSM Binding Script Configuration that receives the JSON Request

  • No labels