Send HTTP Response

Send HTTP Response is a synchronous activity that sends a response to a previously received HTTP request. This activity is used in conjunction with the HTTP Receiver process starter activity and the Wait for HTTP Request activity. The default status line returned by this activity is 200 OK. For HTTP 2 communication, the default status line returned by this activity is 200 null.

General

The General tab has the following fields.

Field Description
Name The name to be displayed as the label for the activity in the process.
Reply For The Wait for HTTP Request activity or HTTP Receiver process starter activity that received the request. This is a list of available activities that can receive HTTP requests.
Flush Response You can specify whether the response is to be flushed after each Send HTTP Response activity.

By default, this property is not selected. This check box is useful when there are a large number of Send HTTP Response activities in a job. In such cases, the Close Connection check box is selected in the last activity to indicate the response is complete.

However, selecting the Flush Response check box overrides this behavior and causes the response to be flushed after each Send HTTP Response activity.

Close Connection Specifies that this activity contains the last part of an HTTP response. This field is used when you have more than one Send HTTP Response activities in a process and each activity sends a part of the response to the client. All Send HTTP Response activities in a process should have this check box clear, except the last Send HTTP Response activity. Select this check box for the last Send HTTP Response activity to indicate the response is complete.

Select this check box, if the entire response is sent by only one Send HTTP Response activity in the process.

Description

Provide a short description for the activity.

Input Editor

Input Editor tab describes the data structure for the headers of the HTTP response. You can use the default structure, or you can alter the structure, if the outgoing response has a specific data structure for the header of the request.

The header structure is defined by the HTTP protocol. For more information about the fields and content of the header of a HTTP request, see the HTTP specification at w3.org.

The following are the default header fields.

Header Datatype Description
StatusLine string This field is the first line of a response message. This consists of the protocol version, a numeric status code, and the text phrase explaining the status code.

For more information about status codes in HTTP responses, see the HTTP specification at w3.org.

Content-Type string This field indicates the media type of the entity body sent to the receiver. The media types are described in the HTTP specification at w3.org. An example of the media type is: text/html; charset=ISO-8850-4.

By default this item is set to text or html. If you are using this activity and the Retrieve Resources activity to retrieve a WSDL file, you should set the type to text or xml when specifying values on the Input tab.

Set-Cookie string For more information about this field, see the HTTP specification at w3.org.
Note: For correct parsing and processing of cookies, input must be in the format "key=value".
Pragma string This field is used to include implementation-specific directives that might apply to the receiver. For more information about this field, see the HTTP specification at w3.org.
Location string This field is used to redirect the receiver to a location other than the RequestURI for the completion of the request or for identifying a new resource.

Conversations

You can initiate the conversation here. Click the Add New Conversation button to initiate multiple conversations. For more information about conversations, see the TIBCO ActiveMatrix BusinessWorks™ Application Development guide.

Input

The following is the input for the activity.

Input Item Datatype Description
binaryContent binary The binary content of the response to the request.
asciiContent string The ASCII content of the response to the request.
Headers complex The fields of the header specified on the Input Editor tab. See the description of the Input Editor tab for more information about these items.
Note: Only the first Send HTTP Response activity in the process can set the Headers element. If your process contains multiple Send HTTP Response activities, the headers are set by the first activity and this element is ignored for all subsequent activities.
DynamicHeaders complex The dynamic header is an additional header parameter to add runtime headers to the outgoing HTTP messages. This element is specified on the Input tab. DynamicHeaders consists of the following information:
  • Name: the name of the header
  • Value: the value of the header

You can consider the following overriding conditions:

  • Overrides the value of the HeaderName with the value found in the DynamicHeaders, if it is a non-repeating header. If more than one occurrence of this header is found under DynamicHeaders, it throws the following exception: The header [ headerName ] is defined as non-Repeating Header in Input Editor. This header cannot have multiple occurences in DynamicHeaders.
  • If it is a repeating element, add the respective name value pairs under DynamicHeaders. This is added to the existing list maintained for this element.
  • For a repeating element, if the new header name is not found under the Headers section in TIBCO Business Studio™ for BusinessWorks™, the following is added into the HTTP headers.
    • Shows only one value, if found once in the DynamicHeaders.
    • Shows an array of values, if found repeating in DynamicHeaders.
mimeEnvelopeElement complex This element contains the message attachments.

This element contains a repeating element named mimePart that contains each mime attachment.

mimeHeaders complex This element contains the mime header for each mimePart. mimeHeaders can contain the following information:
  • content-disposition: to suggest a filename for an attachment, use "*;filename=<filename>" in this element.
    Note: The HTTP servers may alter or ignore the suggested name.
  • content-type
  • content-transfer-encoding
  • content-id
  • any element

For more information about MIME headers and their syntax, see http://www.faqs.org/rfcs/rfc2045.html.

Note: When the content type is specified as "text/*" (for example, "text/xml"), the attachment content is either the textContent input element or the file name storing the attachment is in the fileName input element. When the content type is anything other than "text/*", the attachment content is in either the binaryContent input element or the file name storing the attachment is in the fileName input element.
binaryContent | textContent | fileName choice This element is the content of the attachment. when the attachment is binary data. This element contains the mime attachment. The element can be one of the following:
  • binaryContent: content of the attachment when the attachment is binary data.
  • textContent: content of the attachment when the attachment is text data.
  • fileName: the file name of the attachment written to the disk.

Fault

The Fault tab lists the possible exceptions generated by this activity. For more information about error codes and the corrective action to take, see the TIBCO ActiveMatrix BusinessWorks™ Error Codes guide.

Fault Generated When..
HttpCommunicationException An HTTP exception occurred when sending the response.