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 working list argument is specified then the fields defined in that list are available to the loaded service. If no working 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
|
Return Values
|
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.7 Command.
The JSMX_COMMAND has a number of:
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)