Step 3 Create Request and Response Sample Files

LANSA Composer

Step 3. Create Request and Response Sample Files

LIC009 - Handle multiple requests via an email attachment

In this step, you will create three text files and save them in the Tutorial folder:

\\<SRV400>\LICComposer\lic\Tutorial

1.  Use Notepad to create the Request CSV sample file. This file will contain a list of these employee numbers:

     EmployeeNumber

     A0193

     A1003

     A1012

 

2.  Save the file using the Save as type: All Files option so that you can specify the CSV file extension. Give it a name such as iiiTUTEMPNO.csv.

     Note: Although the file is a Comma Separated File (CSV), you will not see commas because there is only one data column.

3.  In a similar way, create the Response XML sample. The contents of  iiiTUTEMPDET.xml will be like this:

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

<!DOCTYPE Employees SYSTEM "iiiTUTEMPDET.dtd"  >

<Employees>

  <Employee>

    <EmployeeNumber>A9999</EmployeeNumber>

    <LastName>Smith</LastName>

    <FirstName>Fred</FirstName>

  </Employee>

  <Employee>

    <EmployeeNumber>A7117</EmployeeNumber>

    <LastName>Doe</LastName>

    <FirstName>John</FirstName>

  </Employee>

</Employees>

 

     Note: change the iii in <!DOCTYPE Employees SYSTEM "iiiTUTEMPDET.dtd"  > to your initials.

4  Save the file as iiiTUTEMPDET.xml. Once again ensure you use the Save as type: All Files option to ensure Notepad saves the file with the .xml extension.

5.  Create the response DTD file. The DTD file is used to describe the tags of XML files:

     <!ELEMENT Employees (Employee)>

 

<!ELEMENT Employee (EmployeeNumber,FirstName,LastName,Address1,Address2,Address3,PostCode,Department)>

 

<!ELEMENT EmployeeNumber (#PCDATA)>

<!ELEMENT LastName (#PCDATA)>

<!ELEMENT FirstName (#PCDATA)>

<!ELEMENT Address1 (#PCDATA)>

<!ELEMENT Address2 (#PCDATA)>

<!ELEMENT Address3 (#PCDATA)>

<!ELEMENT PostCode (#PCDATA)>

<!ELEMENT Department (#PCDATA)>

 

6.  Save the file as iiiTUTEMPDET.dtd  ensuring that the filename extension is preserved.

     Note: This file's name must be the same name as specified in the DOCTYPE in the xml file just created.