HTTP_SEND_FILE

This activity may be used to send a file to an HTTP server (usually using the HTTP POST method) and to receive response data from the server.

The activity is valid only with an outbound HTTP session – that is one that was initiated using the HTTP_BEGIN_OUTBOUND activity.  For more information on outbound HTTP processing in LANSA Composer, refer to:

HTTP Outbound (Client) Processing in LANSA Composer

 

After executing this activity, if response content is received (as identified by the output parameter values), then your Processing Sequence may use one or more of these activities to receive the HTTP response content:

HTTP_MULTIPART_GET

Get inbound multipart component item

HTTP_PROPERTY_GET

Get HTTP protocol property value(s)

HTTP_RECEIVE_FILE

Receive a single file HTTP payload

HTTP_RECEIVE_MULTI

Receive HTTP payload as multipart content

HTTP_RECEIVE_NAMEVAL

Receive HTTP payload as name-value pairs

 

\

If you wish to send further HTTP requests you should use the following activity before preparing and sending the next request:

HTTP_RESET

Reset for further HTTP outbound requests

 

 

INPUT Parameters:

HTTP_HANDLE: Required

This parameter must specify the session handle value that identifies the HTTP session upon which this activity should operate.  The session handle value is returned by the HTTP_BEGIN_OUTBOUND activity.

HTTP_SENDFP: Optional

This parameter is optional. If provided, it must specify the path and file name of the file to be sent.  If this parameter is not provided, then the value will be taken from the HTTP Configuration Details.

HTTP_SENDCT: Optional

This parameter is optional. If it contains a non-blank value it will be used as the content type.  If this parameter is not provided, then the value will be taken from the HTTP Configuration.

If the content file type in this parameter and in the HTTP configuration are blank, or specify the special value *AUTO, then the content type will be derived from 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.)

Refer to the HTTP Configuration Details, Outbound, for the format and possible special "shorthand" values you may specify for this parameter, such as *XML, *HTML, *CSV, *PDF and *ZIP.  However, you are not limited to those values – you may explicitly specify an actual content type such as application/zip.

HTTP_URI: Optional

This parameter specifies an alternate value used to override the URI that is specified in the HTTP outbound configuration and/or on the HTTP_BEGIN_OUTBOUND activity parameter. If used, the value should specify the URI to be used to connect to the remote host specified in the HTTP outbound configuration.  If this parameter is not specified, then the value will be taken from the HTTP configuration or from the HTTP_BEGIN_OUTBOUND activity parameter, if specified.

HTTP_METHOD: Optional (Advanced)

This parameter specifies the HTTP request method to be used for the outbound HTTP request.  The HTTP protocol standard defines several methods and user-defined methods can be used for REST style applications.  The default value is POST and that would be the most usual value used with this activity.

OUTPUT Parameters:

HTTP_RESPONSESTATUS:

Upon successful completion, and if the HTTP Configuration Details specify that the request should wait for a response, this parameter will contain the response status code received from the HTTP server.  For example, a status of 200 usually indicates that the request has succeeded.  For more information on HTTP response status codes refer to Status Code Definitions.

HTTP_RESPONSEMESSAGE:

Upon successful completion, and if the HTTP Configuration Details specify that the request should wait for a response, this parameter will contain the response reason received from the HTTP server, if any.  The reason (message), if provided, gives a human readable description of the response status code.  For example, response status 200 will often be accompanied by a reason 'OK', usually indicating that the request has succeeded.  For more information on HTTP responses refer to Response.

HTTP_CONTENT_TYPE 

Upon successful completion, and if the HTTP Configuration Details specify that the request should wait for a response, this parameter will contain the actual value of the CONTENT-TYPE header in the HTTP server's response, if any.  For example, text/plain.

HTTP_CONTENT_LENGTH 

Upon successful completion, and if the HTTP Configuration Details specify that the request should wait for a response, this parameter will contain the content length of the content received on the HTTP server's response, if any.

HTTP_RESOLVED_TYPE 

Upon successful completion, and if the HTTP Configuration Details specify that the request should wait for a response, and if response content is received, the activity will resolve the content type received in the HTTP server's response to a single special value that best fits the content type received.  For example, it will be set to *MULTIPART for multipart content, or it may be set to values such as *TEXT, *XML etc.  Refer to the HTTP Configuration Details for a full list of types.