Producing an entity body for an HTTP message

Web-aware application programs can produce an entity body formed from a CICS® document or from a buffer of data.

Before you begin

CICS documents can be used as the entity body of an HTTP message. Use the EXEC CICS DOCUMENT commands to create them. They can be populated by data specified directly by the application program, and by document templates, which are portions of documents defined as CICS resources or created by another CICS program. You can store documents and document templates for reuse.

Alternatively, you can specify a buffer of data created by the application program. You might find this option more convenient for short or simple entity bodies, and you must use this option for chunked transfer-coding for the message. However, data created in this way cannot be stored for reuse so easily.

About this task

Procedure

  1. To create a CICS document, follow the instructions in Creating a document .
    Use the EXEC CICS DOCUMENT application programming interface (EXEC CICS DOCUMENT CREATE, INSERT, and SET commands) to create the document. Use the DOCTOKEN option on the WEB SEND command to specify the document token for the finished document. CICS retrieves the document and performs appropriate code page conversion, depending on the options you specify on the WEB SEND command.
    The body of a chunked message cannot be formed from CICS documents.
  2. Alternatively, assemble a message body in your application program.
    Use the FROM option on the WEB SEND command to specify the buffer of data.
    The size of the data buffer has no set maximum limit, but you must consider the following factors that might limit its size in practice:
    • The EDSA limit for the CICS region.
    • The number of other message bodies that you might be assembling at the same time in the CICS region. Scheduling constraints might be imposed by the MAXACTIVE setting for any transaction class definitions that apply to CICS web support transactions.
    • The type of code page conversion used for the message body. For conversion from the EBCDIC code page 037 to the ASCII code page ISO-8859-1, CICS overwrites the same buffer of data, so no additional storage is used. For any other type of code page conversion, CICS requires additional storage to contain the converted message body. Depending on the character sets used, the size of this additional storage area can range from the same size as the original message body, to a theoretical maximum of four times the size of the original message body (which is unlikely). For example, a 2 MB buffer of data sent using the FROM option requires at least 4 MB of storage in total. Double-byte character sets (DBCS) or multi-byte character sets are likely to require larger storage areas within this range.