A LANSA Composer Processing Sequence can act as HTTP server, receiving and processing inbound HTTP requests and payloads from an HTTP client and preparing and sending the responses.
To implement this functionality in your own Processing Sequences, the main steps are:
- Create one or more HTTP Configurations that connect your inbound solutions (Processing Sequences) with specific inbound HTTP requests. For more information, refer to:
Connect Your Processing Sequence to an Inbound HTTP Request.
- Add the necessary activity(s) to your Processing Sequence to receive, process and respond to the inbound HTTP request.
When implementing HTTP inbound (server) processing, you can choose between two sets of supplied HTTP activities according to your needs:
Simple HTTP Inbound Activities
Advanced HTTP Inbound Activities
Connect Your Processing Sequence to an Inbound HTTP Request
It is the HTTP inbound configuration that provides the connection between an inbound HTTP request received by your HTTP server and the LANSA Composer Processing Sequence.
When you create the HTTP configuration, one of the values you specify is the Application name. In the illustration the Application name is set to EXAMPLE_HTTPUPLOAD.
When you save the HTTP configuration, that Application name value along with other parts of the configuration definition are used to create or update an entry in LANSA Integrator's JSMDirect service table.
It is possible (though not necessary) to open the JSMDirect service table using LANSA Integrator Studio. After saving the above HTTP configuration, we can see the service entry added, and that Application name value has been used as the service name.
The URI that will be used from an HTTP client to access this service will look similar to this:
http://lansa01:8766/cgi-bin/jsmdirect?EXAMPLE_HTTPUPLOAD
Let's break this URI down to understand how it connects to the processing sequence EXAMPLE_HTTPUPLOAD:
1. The first part (http://lansa01:8766) addresses the HTTP request to the HTTP server that is used by LANSA Composer.
2. The next part (/cgi-bin/jsmdirect) tells the HTTP server that LANSA Integrator's JSMDirect CGI program is to be invoked to process the request.
3. The JSMDirect CGI program uses the next part (?EXAMPLE_HTTPUPLOAD) to perform a lookup on its service table (shown above).
From the service table entry, it determines that LANSA Composer's function DXHTFN1 is designated to process the request.
(Function DXHTFN1 is the standard LANSA Composer function provided for this purpose and is associated with all HTTP inbound configurations by default.)
4. Next LANSA Composer uses the service name as an Application name value to locate the matching HTTP inbound configuration.
5. The HTTP inbound configuration (see above) specifies the name of the Processing Sequence to run and LANSA Composer starts that Processing Sequence to process the request.
The Processing Sequence should contain either an HTTP_SIMPLE_INBOUND or HTTP_BEGIN_INBOUND activity along with other directives and activities to process the request and send a response.
So all you need to do to connect your Processing Sequence to an inbound HTTP request is to create an appropriate HTTP inbound configuration, using a unique Application name value that you will use in the URI, and specify the name of the Processing Sequence that you wish to process the request.
Simple HTTP Inbound Activities
LANSA Composer provides a single activity that allows your inbound solution to receive an inbound HTTP request with an optional file payload, process it and prepare and send a response, all in one operation. It is:
Handles an inbound HTTP message and saves it to a specific directory. |
For many simple cases, the HTTP_SIMPLE_INBOUND activity is the quickest and easiest to implement. However, for more advanced functionality, such as receiving or responding with name-value pairs, multipart data and more, then you need to use the Advanced HTTP Inbound Activities instead.
Advanced HTTP Inbound Activities
LANSA Composer provides a set of advanced HTTP activities that provide maximum flexibility to receive and respond to an inbound HTTP request. Using these activities it is possible to perform HTTP inbound processing well beyond the capabilities of the HTTP_SIMPLE_INBOUND activity.
When implementing an inbound HTTP solution using these activities, you will always "bracket" the HTTP processing with these activities:
Begin HTTP inbound request handling | |
End HTTP request processing |
The HTTP_BEGIN_INBOUND activity connects your Processing Sequence with the inbound request received through your HTTP server. The HTTP_END activity indicates that the HTTP inbound processing is complete and associated resources may be freed.
In between those activities you will include one or more other of the HTTP advanced activities that apply to inbound requests. Which activities you use will depend on the specific requirements – for example, whether you wish to receive (and respond with) a file, name-value pairs or multipart formats and whether you need to get or set HTTP header properties.
You may use one or more of the following activities to receive details and content of the inbound HTTP request:
Get inbound multipart component item | |
Get HTTP protocol property value(s) | |
Receive a single file HTTP payload | |
Receive HTTP payload as multipart content | |
Receive HTTP payload as name-value pairs |
After successfully receiving the HTTP request, you may use one or more of the following activities to prepare and send the HTTP response:
Set outbound multipart component item | |
Set HTTP protocol property value(s) | |
Send file as response to HTTP request | |
Send multipart content as response to HTTP request | |
Send name-value pairs as response to HTTP request | |
Send status as response to HTTP request |
The supplied example Processing Sequence EXAMPLE_HTTPUPLOAD demonstrates the use of HTTP_BEGIN_INBOUND and other advanced HTTP activities to receive and process a request from an HTTP client and generate and send a response.
(Refer to Example Processing Sequences for information on installing and using the example Processing Sequences. Refer to the notes supplied with Processing Sequence EXAMPLE_HTTPUPLOAD for instructions for its use.)


