HTTP_INBOUND

LANSA Composer

HTTP_INBOUND

This activity may be used to process an inbound HTTP request. It will receive the content of the HTTP request and save it to a specific directory.  The name and location of the saved content will be output as a parameter value.

Other identifying criteria relating to the HTTP message will be output as parameter values.

This activity is designed to be invoked in the following way:

1.  LANSA Integrator's JSMDIRECT CGI program is invoked to handle the in-coming request

2.  JSMDIRECT uses the application name specified in the URI of the in-coming request to determine the name of a program or LANSA function to process the request.  In the context of the HTTP inbound support in LANSA Composer, this is usually the supplied DXHTFN1 function.

3.  Function DXHTFN1 uses the application name specified in the URI of the in-coming request to determine the name of a LANSA Composer processing sequence to process the request.

4.  The processing sequence should include this activity to receive and save the HTTP content.

In LANSA Composer, the application name specified in the URI of the in-coming request is associated with the function (usually DXHTFN1) and the processing sequence by means of an HTTP inbound configuration.  Creating or modifying an appropriate HTTP inbound configuration will also maintain the necessary entries in the tables used by JSMDIRECT.

This activity is nominally an iterator activity, although it is unusual insofar as it iterates only once.  It is defined as an iterator activity in order to allow any processing sequence directives nested beneath it to process the received content and prepare the response payload, if any.  You can nest transformation maps, other activities or whatever directives you need to perform this.  The activity's input parameters (RESPONSEFILEPATH and RESPONSECONTENTTYPE) that specify the response payload are not evaluated until the iteration completes - so your nested processing sequence directives can set their values.

INPUT Parameters:

 

RESPONSEFILEPATH : Optional

This parameter can specify the path and file name of a file containing content (of the type specified in the RESPONSECONTENTTYPE parameter) that is to be sent in response to the inbound HTTP request.  If specified, the content of the file is sent in response.  If not specified, then the activity sends a 200 (OK) response status along with the OKHTTP response message specified in the HTTP configuration (if any).

Note that this parameter is not evaluated until the iteration completes - so your nested processing sequence directives can set its value according to the nature or content of the request received.

RESPONSECONTENTTYPE : Optional

If you specify the RESPONSEFILEPATH parameter, then you must specify the corresponding content type (eg *TEXTPLAIN) for the response content.  This parameter is not used if the RESPONSEFILEPATH parameter is not specified.

Note that this parameter is not evaluated until the iteration completes - so your nested processing sequence directives can set its value according to the nature or content of the request received.

OUTPUT Parameters:

 

HTTP_CONTENT 

This value will contain the path and file name of the saved inbound HTTP content.

For example :    On an IBM i server        /inorders/HI25.dat

On a Windows server     C:\order\HI123.dat

The directory will be taken from the system setting HTTP inbound payload directory.

The file name will be derived from a prefix plus a unique number plus .dat extension. The prefix is taken from the system setting HTTP inbound filename prefix.

HTTP_CONTENT_TYPE 

This value will contain all the content types which are applicable to the content.

For example, a Comma Separated file will have a value of  *TEXT *SV *CSV

Refer to the 2.3.3 HTTP Configuration for a full list of types.

HTTP_CONTENT_TYPE2 

This is an alternate representation of the content type.  It will contain the actual value of the CONTENT-TYPE HTTP header.  For example, text/plain.

HTTP_CONTENT_LENGTH 

This value will contain the content length of the content received on the HTTP inbound request.

HTTP_QUERY_STRING 

This value will contain the query string from the URI.

If the full URL was  http://lansa01:8080/cgi-bin/jsmdirect?ZZorders

then the query string would have a value of ZZorders.

HTTP_REMOTE_ADDRESS 

This value will contain the IP address of the remote server.

HTTP_REMOTE_USER

This value will contain the remote user if available.

HTTP_SERVER_PORT

This value will contain the local port number that serviced this inbound HTTP message.

Function DXHTFN1 - supplied JSMDirect function.

Function DXHTFN1 in process DXPROC02 is supplied to be invoked by HTTP JSMDirect.

This function will retrieve the query string from the URI. It will trim the query string to remove any additional parameters. The resulting string is used to locate the Composer HTTP Inbound Configuration with the corresponding Application Name.
The Processing Sequence on that Composer HTTP Configuration is then launched. This Processing Sequence should contain the HTTP_INBOUND Activity to retrieve the payload and information from the inbound HTTP transmission.