3.2.3 JSMX_COMMAND

The JSMX_COMMAND Built-In Function is used to load and unload services and execute commands supported by the service. The JSMX_COMMAND can only be executed once a JSMX_OPEN has completed successfully.

If an optional field list argument is specified then the fields defined in that list are available to the loaded service. If no field list argument is specified then no fields are available to the loaded service. This field list does not require an entry only the list definition is used to determine which fields are send to the JSM service.

If an optional working list return value is specified then that working list is available to the loaded service.

Syntax:

Arguments

No

Type

Required
Optional

Description

Min
Length

Max
Length

Min
Decimal

Max
Decimal

1

A

Required

Connection Handle

4

4

 

 

2

U

Required

Command

1

Unlimited

 

 

3

L

Optional

List of field definitions to send/receive. If this list is not passed, no fields will be used.

 

 

 

 

 

Return Values

No

Type

Required
Optional

Description

Min
Length

Max
Length

Min
Decimal

Max
Decimal

1

U

Required

Status

1

20

 

 

2

U

Required

Message

1

Unlimited

 

 

3

L

Optional

Working List

 

 

 

 

 

A service is loaded before commands to the service are executed. A service is unloaded once you are finished using it. Only one service can be loaded at a time. Refer to 3.5 Command.

The JSMX_COMMAND has a number of:

RDMLX Reserved Commands

RDMLX Reserved Keywords

RDMLX Reserved Field Names

For command services details, refer to Java Service Manager Services.

Technical Note 1

For a service to receive HTTP posted content, the SERVICE_CONTENT(*HTTP) keyword is required on the SERVICE_LOAD command.

If this is the first connection to use the SERVICE_CONTENT(*HTTP) keyword, then the posted HTTP content is read and sent to the service.

This connection takes responsibility for sending the HTTP response.

If this is NOT the first connection to use the SERVICE_CONTENT(*HTTP) keyword, then this connection only takes responsibility for sending the HTTP response. The SERVICE_LOAD command does NOT receive the HTTP content, but does receive the HTTP keywords.

When the connection that is responsible for the HTTP response uses the JSMX_CLOSE to close the connection, the returned byte array response becomes the HTTP response.

Only one connection can have responsibility for sending the HTTP response at a time.

HTTP content can only be read once.

HTTP response can only be written once.

HTTP keywords are always sent with the SERVICE_LOAD command.

Scenario A

 

#1 JSMX_OPEN - open connection

#2 JSMX_OPEN - open connection

#3 JSMX_OPEN - open connection

#1 JSMX_COMMAND( "SERVICE_LOAD SERVICE(xxx) SERVICE_CONTENT(*HTTP)" ) - send CGI keywords, read STDIN, claim ownership

#2 JSMX_COMMAND( "SERVICE_LOAD SERVICE(xxx)" ) - send CGI keywords

#3 JSMX_COMMAND( "SERVICE_LOAD SERVICE(xxx) SERVICE_CONTENT(*HTTP)" ) - send CGI keywords, transfer ownership

#1 JSMX_CLOSE - close connection

#2 JSMX_CLOSE - close connection

#3 JSMX_CLOSE - close connection and write STDOUT

 

Scenario B

 

#1 JSMX_OPEN - open connection

#1 JSMX_COMMAND( "SERVICE_LOAD SERVICE(xxx) SERVICE_CONTENT(*HTTP)" ) - send CGI keywords, read STDIN, claim ownership

#1 JSMX_CLOSE - close connection and write STDOUT

#2 JSMX_OPEN - open connection

#2 JSMX_COMMAND( "SERVICE_LOAD SERVICE(xxx)" ) - send CGI keywords

#2 JSMX_CLOSE - close connection

#3 JSMX_OPEN - open connection

#3 JSMX_COMMAND( "SERVICE_LOAD SERVICE(xxx) SERVICE_CONTENT(*HTTP)" ) - send CGI keywords, transfer ownership

#3 JSMX_CLOSE - close connection

 

Technical Note 2

The following data types are supported. If any other data type is used, that field will be ignored and not passed to the JSM service.

 

TYPE(*CHAR)

TYPE(*NCHAR)

TYPE(*STRING)

TYPE(*INT)

TYPE(*DEC)

TYPE(*FLOAT)

TYPE(*PACKED)

TYPE(*SIGNED)

TYPE(*BOOLEAN)

TYPE(*DATE)

TYPE(*TIME)

TYPE(*DATETIME)

TYPE(*BLOB)

TYPE(*CLOB)