Multipart for nHTTP Preparser (com.ibi.preparsers.XDMultiPartForNHTTP)

Syntax:

com.ibi.preparsers.XDMultiPartForNHTTP

Description:

The Multipart for nHTTP preparser divides multipart documents into body and attachments. This preparser can also be used with an nHTTP listener. This preparser must be last in the chain. When used, the multipart message is broken up so that the body of the multipart message is part 0 and subsequent attachments are 1 to n.

In a use case scenario, the Multipart for nHTTP preparser is useful when the incoming message is a multipart document and the headers and attachment portions of the document need to be extracted from the document for additional message processing.

Parameters:

Parameter

Description

Keep Message Flat

Determines whether to keep the body of the message as an array of bytes. Select true or false from the drop-down list.

Message Header Namespace

A special register namespace where message headers can be found. If not supplied, HDR registers from the default namespace will be used.

Payload Header Namespace

A special register namespace into which any headers on the extracted body part will be stored as HDR registers. If not supplied, body part headers will be saved in the default namespace.

Example:

  1. Select the Multi Part For NHTTP (com.ibi.preparsers.XDMultiPartForNHTTP) preparser from the Type drop-down list and click Next.

    The configuration parameters pane opens.

  2. Leave the Payload Header Namespace and Message Header Namespace fields blank.
  3. Select false from the Keep Message Flat drop-down list and click Next.

    The name and description pane opens.

  4. Enter a name (for example, nhttpmultipart) and an optional description.
  5. Click Finish.
  6. Construct an inlet, for example, FileInlet, which is associated with a file listener and the new preparser (nhttpmultipart).
  7. Define a simple move route.
  8. Define an outlet that consists of a File emitter, which emits the output document (outmpart*.xml) to an output directory.
  9. Build, deploy, and start the channel.
  10. Use a multipart document for the input, which is generated from an email attachment. For example:
    content-type: multipart/mixed; 
    boundary="----=_Part_5_23514719.1234266657921"
    content-length: 571
    mime-version: 1.0
    message-id: <17237217.1234266657984.JavaMail.soumya@ibi>
    ------=_Part_5_23514719.1234266657921
    Content-Type: application/xml
    Content-Transfer-Encoding: 7bit
    Content-Disposition: attachment; filename=a.xml
    <a>a</a>
    ------=_Part_5_23514719.1234266657921
    Content-Type: text/document
    Content-Transfer-Encoding: 7bit
    Content-Disposition: attachment; filename=b.xml
    Content-Id: mydata1
    <b>b</b>
    ------=_Part_5_23514719.1234266657921
    Content-Type: text/document
    Content-Transfer-Encoding: 7bit
    Content-Disposition: attachment; filename=c.xml
    Content-Id: mydata2
    <c>c</c>
    ------=_Part_5_23514719.1234266657921-

    When this input document is processed by the channel, an output document (outmpart*.xml) is generated with the following contents:

    <?xml version="1.0" encoding="ISO-8859-1" ?>