Step 1 Create XML iiiPRO05_request xml

LANSA Integrator

Step 1. Create XML iiiPRO05_request.xml

INT007 - Department List Inquiry

In this step, you will write the XML to get the request for department descriptions. You can use any text editor to write XML. You will start by editing the XML used in INT005.

1.   Begin in Integrator Studio with your iii Training project open. Right click on solutions and create a New Solution Group XML List Request.

2.  Expand the XML Request folder which you created in INT005, and double click on iiiPRO04_request.xml to open it in the XML Editor.

 Your XML should appear as follows:

<?xml version="1.0" encoding="UTF-8"?>

<DepartmentRequest>

 <DepartmentCode>ADM</DepartmentCode>

</DepartmentRequest>

 

3.  Modify the name of root tag <DepartmentRequest> and its closing tag </DepartmentRequest> to refer to a list of departments.

     Your XML might appear as follows:

<DepartmentListRequest>

   <DepartmentCode>ADM</DepartmentCode>

<DepartmentListRequest>

 

4.  The simple field you are going to pass is just an alphanumeric string that the server function is going to reverse and then return back to you. Within the root tag, add a tag for the simple field. Include a sample value in the new tag.

     Your XML might appear as follows:

<DepartmentListRequest>

   <ReverseString>ABCDEFG</ReverseString>

   <DepartmentCode>ADM</DepartmentCode>

</DepartmentListRequest>

 

5.  Next, you have to change the XML so that the department code occurs multiple times because it is a list. You will make the department code tag become the parent tag of the actual code tag.

a.  Delete the ADM literal between the opening <DepartmentCode> and closing  </DepartmentCode> tags and move the closing </DepartmentCode> to the next line so that it aligns with the opening <DepartmentCode>.

b.  Rename the <DepartmentCode> tag and call it just <Department>. (This is not necessary but it will eliminate redundancy in the terminology as you are going to add a child tag with the actual department.)

     Your XML might appear as follows:

<DepartmentListRequest>

  <ReverseString>ABCDEFG</ReverseString>

   <Department>

  </Department>

</DepartmentListRequest>

 

6.  Insert a child tag of <Department> with a sample value of ADM. Call the child tag <Code>. Remember that all tags require a closing tag. Make sure you indent the child tag to make for easier reading.

     Your XML might appear as follows:

<DepartmentListRequest>

    <ReverseString>ABCDEFG</ReverseString>

    <Department>

       <Code>ADM</Code>

     </Department>

</DepartmentListRequest>

 

7.  Finally, you have to modify the XML to represent the multiple occurrences of the Department code. There are a several ways to accomplish this task. One method is to repeat the child tags <Code></Code>:

<Department>

    <Code>ADM</Code>

    <Code>FLT</Code>

</Department>

 

     Alternatively, for this exercise, you will simply repeat the <Department></Department> tag making another block. This will make the request and response XML structurally the same.

     Your XML might appear as follows:

<?xml version="1.0" encoding="UTF-8"?>

<DepartmentListRequest>

    <ReverseString>ABCDEFG</ReverseString>

    <Department>

        <Code>ADM</Code>

     </Department>

     <Department>

        <Code>FLT</Code>

      </Department>

</DepartmentListRequest>

 

     Remember that the line <?xml version= . . . . . . .> must be the first line and have no other leading characters or lines.

8.  Using the File menu, select the Save As option as specify the file as iiiPRO05_request.xml. Save it to the folder XML List Request.