Step 1. Create a User Agent Solution and edit Host Properties file
INT004 - Using the LANSA User Agent
In this step you will use Integrator Studio to define a new project
. You will define a SendCSVFile user agent solution within this project and define the Host Properties required by this User Agent solution.1. Open Integrator Studio. Right click on
, select .
2. Create a project called iii Training, where iii is your unique three letters.
3. The project will open in a new tab:
4. Select
and right click to create a :
5. Select
from the dropdown.
6. Define a SendCSVFile and the select Yes in the dialog.
and called
7. The
will open:
You are now going to create the
file (.lih) which the User Agent will use. This is a configuration file which provides the parameters required by the User Agent. The User Agent will perform the upload (in this case a CSV file) based on the configuration parameters.8. Scroll down to # HTTP Directives. All lines beginning with # are comments lines:
9. Change the "name" line to read name=iii CSV Service.
10. Enter the host IP address and port details that will tell the User Agent where to find JSMDirect.(If you are testing using a local Windows web server and JSM Server, you can use http://localhost:80.)
11. If your web server uses authentication, you would also enter user and password details.
12.If your web server uses a proxy, you would enter these details, including authentication details if required.
13.Enter the file type to tell the User Agent how to display a data file of this type, prior to sending it. Using the
facilities in the editor, locate lines containing # CSV. Remove the # and spaces at the beginning of this line:csv=text/comma-separated-values; charset=utf-8
14.Again, use
to locate the lines containing URI (Uniform Resource Identifier). This information will tell the User Agent that source files of type .CSV should be handled by the server program iiiFN05, which you will create in a later step.When using a Java Services Manager (JSM) running on an IBM i server, the JSM will locate the entry in DC@W29 where the local host and server program identifier match. For a LANSA function the information recorded includes process, function and partition. Modify the entry for csv.uri=/cgi-bin/jsmproxy?ordersv. Your entry should look like the following:
If you are using the JSM on a Windows server, the file DC_W29.txt is used to look up the function or program to call as described above. In this case your entry would look like the following:
csv.uri=/cgi-bin/jsmdirect.exe?iiiFN05_SERVICE
You will define the service entry for function iiiFN05 in Step 4. JSMDirect Service Configuration.
15.Save your changes and select Yes in the dialog.
16.Exit the
.