Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this tutorial you will use LANSA Integrator Studio to create a new JSON binding solution to write a JSON response that will contain the requested batch and order information.

  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 ResponseTutordJSON. Click Yes to create solution group dialog box.
    Image Modified
  2. From the JSON Type Selection dialog box select TutordResponseJSON.
    Image Modified
  3. Select the Configuration tab and change the Package to au.com.ResponseTutordJSON.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 solotion also called au.com.ResponseTutordJSON.service.json then this would overwrite your other instances using this package (name).
    Image Modified
  4. Select the Mapping tab and right click the 'parent' node TutordResponseJSON and select Fragment.
    Image Modified
    Notice that the two 'child' nodes are now displayed with a red colored diamond and default names are allocated to both the nodes (TUTORDHRESPONSE & TUTORDLRESPONSE) and the individual elements.  We will change the individual element name assignments in the following steps.
  5. Expand the TUTORDHRESPONSE node and double-click on BatchNumber to open the field attributes. Change this to the field DXBINDF0A.
    Image Modified
    Repeat for the remaining fields:

  6. No Format     Continue

  7. Continue to

  8. modify

  9. TUTORDHRESPONSE

  10. changing:



  11.      CustomerNumber

  12. to

  13. DXBINDF0B


  14.  

  15.  

  16.  OrderNumber

  17. to

  18. DXBINDF0C


  19.  

  20.  

  21.  OrderDate

  22. to

  23. DXBINDF0D

    Expand TUTORDLRESPONSE and change:

  24. No FormatBatchNumber to DXBINDF0A OrderNumber to DXBINDF0B OrderLineNumber

  25. to DXBINDF0C PartNumber to DXBINDF0D LinePrice to DXBINDF0E LineQuantity to DXBINDF0F LineValue to
  26.      BatchNumber to DXBINDF0A
         OrderNumber to DXBINDF0B
         OrderLineNumber to DXBINDF0C
         PartNumber to DXBINDF0D
         LinePrice to DXBINDF0E
         LineQuantity to DXBINDF0F
         LineValue to DXBINDF0G


    You will use these field names later on when creating the JSM Binding Scripts.

  27. 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:
    Image Modified
  28. Click Ctrl-S to Save and then Alt-F4 to Exit
  29. Back in the LANSA Integrator Studio window, expand the ResponseTutordJSON solution, then right-click on the ResponseTutordJSON.json.jar file and select Send To / Integrator Folder from the popup menu.
    Image Modified
  30. Repeat the previous step for the JSONFileBindService.properties file.
  31. 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 ResponseTutordJSON solution from your PC to the server.
  32. Expand the Integrator item in the tree on the left-hand side, then expand the bindings folder and locate the ResponseTutordJSON.json.jar file.  Right-click the file and select Publish File from the popup menu.  Click Yes when prompted to confirm the request.
    Image Modified
  33. 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.
    Image Modified
  34. 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.
    Image Modified
  35. Close LANSA Integrator Studio and continue with the next tutorial.

Now continue with the following tutorial:

JSM026 - Create a JSM Binding Script Configuration that prepares the JSON Response