InboundSeparatedValue
The InboundSeparatedValue handler is used to receive posted separated values and to send separated values as a reply.
When the RECEIVE command of this content handler is executed the following steps occur:
If there is no content or list argument, then an OK status is returned.
The handler checks that the content type belongs to the separated values group of content types, if it does not support the content type, then an error is returned to the program. Use the CONTENT keyword to override this check and to allow the handler to receive the data, it is assumed the data is CSV.
The handler determines the encoding to apply to the receive byte stream to convert it to Unicode.
The handler determines if this Unicode data needs to be archived.
The handler reads the separated values into the working list.
Syntax:
|
Example
RECEIVE HANDLER(InboundSeparatedValue) SVHEAD(ORDER) SERVICE_LIST(…)
When the SEND command of this content handler is executed the following steps occur:
The handler uses the value of the CONTENT keyword to determine the type of separated values to create:
- If no content value is available, the handler defaults to application/comma-separated-values
- If the content value is *CSV, then content type will be application/comma-separated-values
- If the content value is *TEXTCSV, then content type will be text/comma-separated-values
- If the content value is *TSV, then content type will be application/tab-separated-values
- If the content value is *TEXTTSV, then content type will be text/tab-separated-values
- If the content value is not a valid separated value content type then CSV data is created, but the specified content type is sent.
The optional SVHEAD keyword allows a header record to be inserted at the beginning of the data.
The handler creates Unicode data using all entries in the list, if there is no list argument then zero length content is created.
The handler determines if this Unicode data needs to be archived.
The handler creates a HTTP response to return to the remote client.
The optional UAFILE and UAPATH keywords are available to inform the remote client program of a recommended path and filename for the content. LANSA Integrator UserAgent will add these file and path names to the save popup menu on the response panel.
Syntax:
|
Example
SEND HANDLER(InboundSeparatedValue) CONTENT(*CSV) UAFILE(order.csv) SERVICE_LIST(…)