HTTP Server Connector

IBM Security Directory Integrator provides a HTTP Server Connector that listens for incoming HTTP connections and acts like a HTTP server. You can use the information provided here to know more about this.

Once it receives the request, it parses the request and sends the parsed request to the AssemblyLine workflow to process it. The result is sent back to the HTTP client. By default, the returned result has a content-type of "text/html".

The Connector supports Server and Iterator Modes. Server mode is the recommended mode:
  • In Server Mode, when the connection is accepted, the connector clones AssemblyLine and hands the request off to the clone. The parent process resumes waiting for new incoming connections.
  • In Iterator Mode, this cloning does not happen and the request is handled in the current AssemblyLine itself. However, once the request has been processed, the connection (and hence, the AssemblyLine) will end. This may not suit your purpose.

If a Parser is specified, the connector processes post requests and parses the contents using the specified Parser; get requests do not use the Parser. If a post request is received and no Parser is specified, the contents of the post data is returned as an attribute (postdata) in the returned entry.

The HTTP Server Connector uses ibmdi.HTTP as internal Parser if no Parser is specified.

The Connector parses URL requests and populates an entry in the following manner:

http://localhost:8888/path?p1=v1&p2=v2

http.method :	'GET'
http.Host   :	'localhost:8888'
http.base   :	'/path'
http.qs.p1  :	'v1'
http.qs.p2  :	'v2'
http://localhost:8888/?p1=v1&p2=v2

http.method :	'GET'
http.Host   :	'localhost:8888'
http.base   :	'/'
http.qs.p1  :	'v1'
http.qs.p2  :	'v2'

If a post request is used then it is expected that the requestor is sending data on the connection as well. Depending on the value for the Parser parameter the Connector performs the following actions:

Parser present
Instantiates the Parser with the HTTP input stream. Connector delegates getNext to the Parser's getEntry and returns whatever the Parser returns.
Parser not present
Puts contents of post data in a Connector attribute called http.body.

The session with the HTTP client is closed when the Connector receives a getNext request from the AssemblyLine and there is no more data to fetch. For example, if the Parser has returned a null value, or on the second call to getNext if no Parser is present.