HTTPInput node

This topic contains the following sections:

Purpose

Use the HTTPInput node to receive Web service requests for processing by a message flow. Using the HTTPInput node with the HTTPReply and HTTPRequest nodes, the broker can act as an intermediary for Web services, and Web service requests can be transformed and routed in the same way as other message formats supported by WebSphere Message Broker. Web Service requests can be received either in standard HTTP (1.0 or 1.1) format, and also in HTTP over SSL (HTTPS) format. You can set the Use HTTPS property to choose whether to handle HTTP or HTTPS requests.

If you include an HTTPInput node in a message flow, you must either include an HTTPReply node in the same flow, or pass the message to another flow that includes an HTTPReply node (for example, through an MQOutput node to a second flow that starts with an MQInput node). In the latter case, the request from, and reply to, the client are coordinated by the request identifier stored in the LocalEnvironment (described below).

The HTTPInput node handles messages in the following message domains:

  • MRM
  • XML
  • XMLNS
  • XMLNSC
  • JMS
  • JMSStream
  • IDOC
  • MIME
  • BLOB

When the HTTPInput node receives a message from a Web service client, it invokes the appropriate parsers to interpret the headers and the body of the message, and to create the message tree that is used internally by the message flow. The node creates a unique identifier for the input message and stores it as a binary array of 24 bytes in the LocalEnvironment tree at LocalEnvironment.Destination.HTTP.RequestIdentifer. This value is used by the HTTPReply node and must not be modified in any way.

HTTP messages are always non-persistent, and have no associated order.

HTTP messages are non-transactional. However, if the message flow interacts with a database or another external resource such as a WebSphere MQ queue, these interactions are performed transactionally. The HTTPInput node provides commit or rollback depending on how the message flow has ended, and how it is configured for error handling (how failure terminals are connected, for example). If the message flow is rolled back by this node, a fault message is generated and returned to the client. The format of the fault is defined by the Fault Format property

If an exception occurs downstream in this message flow, and is not caught but is returned to this node, the node constructs an error reply to the client. This error is derived from the exception and the format of the error is defined by the Fault Format property.

If you include an output node in a message flow that starts with an HTTPInput node, it can be any of the supported output nodes (including user-defined output nodes). You can create a message flow that receives messages from Web service clients and generates messages for clients that use all supported transports to connect to the broker, because you can configure the message flow to request the broker to provide any conversion that is necessary.

If you create a message flow to use as a subflow, you cannot use a standard input node; you must use an instance of the Input node as the first node to create an in terminal for the subflow.

If your message flow does not receive Web service requests, you can choose one of the supported input nodes.

The HTTPInput node is represented in the workbench by the following icon:

HTTPInput node icon

Using this node in a message flow

The HTTPInput node can be used in any message flow that needs to accept HTTP or HTTPS messages. The most common example of this is a message flow that implements a web service. For information on web service applications, see Web service applications.

Configuring the HTTPInput node

When you have put an instance of the HTTPInput node into a message flow, you can configure it. Right-click the node in the editor view and click Properties. The node's basic properties are displayed in the properties dialog.

All mandatory properties for which you must enter a value (those that do not have a default value defined) are marked with an asterisk on the properties dialog.

Configure the HTTPInput node as follows:

  1. In URL Selector, put the path part of the URL from which this node receives Web service requests. Do not give the full URL.
  2. Enter the Maximum client wait time timeout interval, as a number of seconds. This is the length of time that the TCP/IP listener that received the input message from the Web service client waits for a response from the HTTPReply node in the message flow. If a response is received within this time, the listener propagates the response to the client. If a response is not received in this time, the listener sends a SOAP Fault message to the client that indicates that its timeout has expired.
  3. Select the Fault Format as one of SOAP 1.1, SOAP 1.2 or HTML.
  4. If the node is to accept secure HTTP, select the Use HTTPS check box.
  5. Select Default in the properties dialog navigator and set values for the properties describing the message domain, message set, message type, and message format that the node uses to determine how to parse the incoming message.
    • In the Message Domain field, select the name of the parser that you are using from the drop-down list. You can choose from:
      • MRM
      • XML
      • XMLNS
      • XMLNSC
      • JMSMap
      • JMSStream
      • IDOC
      • MIME
      • BLOB
    • If you are using the MRM or IDOC parser, select the correct message set from the drop-down list in the Message Set field. This list is populated with available message sets when you select MRM or IDOC as the domain.

      Leave the Message Set field blank for XML, XMLNS, XMLNSC, JMS, MIME, and BLOB parsers.

    • If you are using the MRM parser, select the correct message from the drop-down list in Message Type. This list is populated with messages that are defined in the message set that you have selected.

      Leave Message Type blank for XML, XMLNS, XMLNSC, JMS, IDOC, MIME, and BLOB parsers.

    • If you are using the MRM or IDOC parser, Select the format of the message from the drop-down list in the Message Format field. This list includes all the physical formats that you have defined for this message set. da

      Leave the Message Format field blank for XML, XMLNS, XMLNSC, JMS, MIME, and BLOB parsers.

  6. Select Validation in the properties dialog navigator if you want the MRM parser to validate the body of messages against the dictionary generated from the message set. (If a message is propagated to the failure terminal of the node, it is not validated.)

    For more details refer to Validating messages and Validation properties for messages in the MRM domain.

  7. Select General Message Options in the properties dialog navigator. Parse Timing is, by default, set to On Demand. This causes validation to be delayed until it is parsed by partial parsing. If you change this to Immediate, partial parsing is overridden and everything in the message is parsed and validated, except those complex types with a Composition of Choice or Message that cannot be resolved at the time. If you change this to Complete, partial parsing is overridden and everything in the message is parsed and validated; complex types with a Composition of Choice or Message that cannot be resolved at the time cause a validation failure.
  8. Select Description in the properties dialog navigator to enter a short description, a long description, or both.
  9. Click Apply to make the changes to the HTTPInput node without closing the properties dialog. Click OK to apply the changes and close the properties dialog.

    Click Cancel to close the dialog and discard all the changes that you have made to the properties.

Connecting the terminals

HTTPInput routes each message that it retrieves successfully to the out terminal. If message validation fails, the message is routed to the failure terminal; you can connect nodes to this terminal to handle this condition. If you have not connected the failure terminal, the message is discarded, the Maximum client wait time expires, and the TCP/IP listener returns an error to the client. The are no other situations in which the message is routed to the failure terminal.

If the message is caught by this node after an exception has been thrown further on in the message flow, the message is routed to the catch terminal. If you have not connected the catch terminal, the message is discarded, the Maximum client wait time expires, and the TCP/IP listener returns an error to the client.

Terminals and properties

The HTTPInput node terminals are described in the following table.

Terminal Description
Failure The output terminal to which the message is routed if an error occurs.
Out The output terminal to which the message is routed if it is successfully retrieved.
Catch The output terminal to which the message is routed if an exception is thrown downstream and caught by this node.

The following tables describe the node properties; the column headed M indicates whether the property is mandatory (marked with an asterisk on the properties dialog if you must enter a value when no default is defined), the column headed C indicates whether the property is configurable (you can change the value when you add the message flow to the bar file to deploy it).

The HTTPInput node Basic properties are described in the following table.

Property M C Default Description
URL Selector Yes Yes   Identifies the location from where Web service requests are retrieved. If the URL that you want is http://<hostname>[:<port>]/[<path>], specify either /<path> or /<path fragment>/* where * is a wild card that you can use to mean match any.
Maximum Client Wait Time Yes No 180 How long the listener waits, in seconds, before sending an error message back to the client. The valid range is zero (which means an indefinite wait) to (231)-1.
Fault Format No Yes SOAP 1.1 The property value can be SOAP 1.1, SOAP 1.2 or HTML. This property defines the format of any HTTP errors that are returned to the client.
Use HTTPS No Yes no Identifies whether the node is to accept secure HTTP.

The HTTPInput node Default properties are described in the following table.

Property M C Default Description
Message Domain No No   The domain that will be used to parse the incoming message.
Message Set No No   The name or identifier of the message set in which the incoming message is defined.
Message Type No No   The name of the incoming message.
Message Format No No   The name of the physical format of the incoming message.

The Validation properties of the HTTPInput node are described in the following table.

Refer to Validation properties for messages in the MRM domain for a full description of these properties.

Property M C Default Description
Validate No Yes None Whether validation takes place. Valid values are None, Content and Value, and Content.
Failure Action No No Exception What happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List.
Include All Value Constraints No No Selected This property cannot be edited. The default action, indicated by the check box being selected, is that basic value constraint checks are included in Content and Value validation.
Fix No No None This property cannot be edited.

The properties of the General Message Options for the HTTPInput node are described in the following table.

Property M C Default Description
Parse Timing No No On Demand This property controls when an input message is parsed. Valid values are On Demand, Immediate, and Complete.

Refer to Parsing on demand for a full description of this property.

Use MQRFH2C Compact Parser for MQRFH2 Domain No No Cleared This property controls whether the MQRFH2C Compact Parser, instead of the MQRFH2 parser, is used for MQRFH2 headers.

The properties of the XMLNSC Parser Options for the HTTPInput node are described in the following table.

Property M C Default Description
Use XMLNSC Compact Parser for XMLNS Domain No No Cleared Start of changeThis property gives you control over whether the XMLNSC Compact Parser is used for messages in the XMLNS Domain. Note that if you set this property, the message data will appear under XMLNSC in nodes that are connected to the output terminal when the input RFH2 header or Default properties Domain is XMLNS.End of change
Mixed Content Retain Mode No No None This property controls whether the XMLNSC parser creates elements in the message tree when it encounters mixed text in an input message. Valid values are None and All. Selecting All means that elements are created for mixed text. Selecting None means that mixed text is ignored and no elements are created.
Comments Retain Mode No No None This property controls whether the XMLNSC parser creates elements in the message tree when it encounters comments in an input message. Valid values are None and All. Selecting All means that elements are created for comments. Selecting None means that comments are ignored and no elements are created.
Processing Instructions Retain Mode No No None This property controls whether the XMLNSC parser creates elements in the message tree when it encounters processing instructions in an input message. Valid values are None and All. Selecting All means that elements are created for processing instructions. Selecting None means that processing instructions are ignored and no elements are created.

The HTTPInput node Description properties are described in the following table.

Property M C Default Description
Short Description No No   A brief description of the node.
Long Description No No   Text that describes the purpose of the node in the message flow.