2 3 3 HTTP Configuration

LANSA Composer

2.3.3 HTTP Configuration

The HTTP Configuration may be used to set details of how you wish to send and retrieve payloads using the http protocol. Activities to make use of these Configurations are provided. These are:

  • HTTP_INBOUND for inbound HTTP requests
  • HTTP_GET and HTTP_POST for outbound requests

 

Information for an HTTP Configuration is in two parts:

  • Identification – Identifies the HTTP Configuration and contains basic information.
  • Details – Specific details relating to the type of HTTP Configuration being set up.

Identification

This identifies the HTTP Configuration and contains basic information.

HTTP Configuration ID

An identifier to uniquely identify this Configuration

Description

This should describe the Configuration.

HTTP direction

Inbound or Outbound

Configuration Status

Active or Inactive. Configurations cannot be used in a processing sequence while they are in inactive status – supplied activities will end in error if they attempt to use a configuration that has inactive status.

 

Details

The details section will vary according to the HTTP direction specified in the Identification section.

Inbound

The Inbound HTTP Configuration will set up details for a JSMDirect inbound HTTP. The information entered will create and maintain the function registry used by JSMDirect. This is the DC@W29 table on IBM i or the dc_w29.txt on Windows.
Also the Processing Sequence which is to be launched is entered.

Processing Sequence ID

This must contain the Identity of a Processing Sequence. This Processing Sequence should contain an Activity which will process the payload of the inbound HTTP transmission. A standard Activity HTTP_INBOUND is provided for this purpose.

Application Name

This is the application name which will be registered on the DC@W29/dc_w29.txt table.
It identifies the application to be executed and is part of the URL.
For example: http://lansa01:8080/cgi-bin/jsmdirect?ZZORDERS+ABC
where the Application Name is ZZORDERS.

Local Host

This is the host name which will be registered on the DC@W29/dc_w29.txt table.
It will default to *DEFAULT.
It can contain a value of *DEFAULT or a HostName:Port

Handler Type

Select from Function or IBM i 3GL.
The value selected for this Type will determine what next entry fields are required.

OK HTTP response message

This optional entry may contain the text which is to be sent for an OK response

 

For a Handler Type of Function:

Process Name

This must be the process which contains the Function specified in the following parameter. This defaults to DXPROC02.

Function Name

This is the function that will be invoked by JSMDirect when an inbound HTTP transmission with the specified Application Name in the URL is received.
This defaults to DXHTFN1 which is a supplied function in process DXPROC02. This supplied function will match the inbound URL to the Application Name on this Configuration and then launch the Processing Sequence specified on that Configuration.
Refer to HTTP_INBOUND for a description of this function.

Partition

This must be the LANSA partition which contains the function to be invoked.

Language

This must contain the LANSA execution language.

 

For a Handler Type of IBM i 3GL:

3GL Program

This should contain the program name when a Handler Type of IBM i 3GL is selected.

 

Outbound

The outbound HTTP Configuration is for use in an Activity which sends HTTP requests to a remote HTTP server .

If applicable, the payload is specified as a directory path plus the file name of the content file. The content type may also need to be specified.

Remote Host

This must contain the remote HTTP server and port. The format is host:port
For example  lansa01:8080   or  10.2.1.456:88

If the port is not supplied, it will default to 80.

URI

This must contain the remainder of the URI to be used to connect to the remote server.

Content File Directory

Enter the local directory path which contains the content file.  You can click the prompt button to browse for a folder location on the LANSA Composer server.

Content File Name

Enter the content file name. This file will be used as the payload of the HTTP transmission.

Proxy Server

If a proxy server is being used, enter the proxy server name.

Secure Protocol

Select Yes to use HTTPS (secure protocol) for the HTTP connection.  Select No to use use standard HTTP protocol.

Authentication User

If authentication is required, this contains the basic authentication user.

Authentication password

If authentication is required, this contains the password which is used with the Authentication user.

Wait for response

Select from Yes or No. Select yes if you want the HTTP connection to wait for a response.

Response timeout

If you specified Yes for the Wait for response, then this field can specify a timeout for the response wait, in milliseconds.  For example, specify 5000 for a timeout value of five seconds.  If zero (or a negative value) is specified, then no response timeout applies.

Connection timeout

This field can specify a timeout for the host connection to be established, in milliseconds.  For example, specify 5000 for a timeout value of five seconds.  If zero (or a negative value) is specified, then no connection timeout applies.

Content Type

You may select the content type of the payload which will be sent:

 

*XML

application/xml

*TEXTXML

text/xml

*TEXTPLAIN

text/plain

*SOAP

application/soap+xml

*HTML

text/html

*XHTML

application/xhtml+xml

*CSV

application/comma-separated-values

*TEXTCSV

text/ x-comma-separated-values

*TSV

application/comma-separated-values

*TEXTTSV

text/ x-tab-separated-values

*X12

application/edi-x12

*EDIFACT

application/edifact

*STREAM

application/octet-stream

*PDF

application/pdf

*JSON

application/json

*EXCEL

application/vnd.ms-excel

*ZIP

application/zip

*GIF

image/gif

*PNG

image/png

*JPEG

image/jpeg

*MPEG

audio/mpeg

*MPEG4

video/mpeg4

 

 

Most often, however, you may leave the default Automatic setting, which will result in the HTTP_POST activity setting an appropriate content type according to the file extension of the file being sent.  (This is achieved by a lookup on the file filetype.txt in the <system> directory of the server's JSM instance directory tree.)

Encoding

You may enter an encoding which will be used to convert the content to Unicode.

 

Note: A Test button can be used to check the validity of the parameters for Outbound HTTP Configuration. The parameters tested are: Remote Host, Proxy Server, Secure Protocol, Authentication User and Password, and Connection and Response timeout values, if applicable.