B2B Integration 10.4 | Administering and Monitoring B2B Transactions | Trading Networks Built-In Services Reference | Mime Folder | Summary of Elements in this Folder | wm.tn.mime:addBodyPart
 
wm.tn.mime:addBodyPart
Adds a body part (header fields and content) to a specified MIME object.
Input Parameters
mimeData
Object The MIME object to which to add a body part. You must create mimeData using the wm.tn.mime:createMimeData service.
content
Object or InputStream The content that to add to the MIME object. Specify either an InputStream or another MIME object for content:
*Use an InputStream to add an ordinary payload.
To support the creation of arbitrarily large mime messages, the InputStream should implement the interface javax.mail.internet.SharedInputStream. Use the wm.tn.mime:writeToStream service to obtain a SharedInputStream.
*Use a MIME object to add a payload that is itself a MIME message.
mimeHeader
Document (optional) The header fields to add to the MIME object. Key names represent the names of the header fields. The values of the keys represent the values of the header fields. For example, if to add the following header fields:
X-Doctype: RFQ
X-Severity: 10
You would set the value of the keys of the mimeHeader as follows:
*Value of key X-Doctype as RFQ
*Value of key X-Severity as 10
The wm.tn.mime:writeToStream service automatically inserts the following MIME headers when it generates the MIME message:
Message-ID
MIME-Version
If you set these values in mimeHeader, wm.tn.mime:writeToStream overwrites the values at run-time.
contenttype
String (optional) The value of the Content-type header for this body part. You can also specify this value in mimeHeader. If you specify the value in both, this service uses the value in mimeHeader.
encoding
String (optional) The value of the Content-Transfer-Encoding header for this body part. You can also specify this value in mimeHeader. If you specify the value in both, this service uses the value in mimeHeader.
Encoding determines how the service encodes the payload for transport. When you add a payload to mimeData, it should be in its original format. The wm.tn.mime:writeToStream service performs the encoding when it generates the final MIME message.
Specify one of the following values for encoding:
*7bit - Default. Content contains 7-bit, line-oriented text that needs no encoding.
*8bit - Content contains 8-bit, line-oriented text that needs no encoding.
8bit is not recommended for messages to be transported through SMTP over the Internet because intervening mail servers that alter the data cannot accommodate 8-bit text. To safely transport 8-bit text, use quoted-printable encoding.
*binary - Content contains binary information that needs no encoding.
Binary is not recommended for messages that are transported through SMTP over the Internet, because intervening mail servers that alter the data cannot accommodate binary data. To safely transport binary data, use base64 encoding.
*quoted-printable - Content contains 7 or 8-bit, line-oriented text to encode using the quoted-printable encoding scheme.
*base64 - Content contains an arbitrary sequence of octets to encode using the base64 encoding scheme.
*uuencode - Contains an arbitrary sequence of octets to encode using the uuencode encoding scheme.
multipart
String (optional) If mimeData already contains one or more body parts, whether to append the body part being added, replace the body part(s) in mimeData with the body part being added, or throw an exception if body part(s) exist in mimeData. To construct a multipart document, set this parameter to append the body part. Valid values are:
*yes - Default. Append a new body part to mimeData.
*no - Replace the existing payload with the new body part or throw an exception, as determined by the value for replace.
replace
String (optional) If mimeData already contains a payload, whether to replace the existing payload or throw an exception. This service only ignores replace when multipart is yes. Valid values are:
*yes - Default. Replace the existing payload with the new body part.
*no - Throw an exception.
ignoreMimeVersion
String (optional) Add or ignore the Mime version header field in all the parts of a multi-part message. Valid values are:
*yes - Ignores the Mime version header field.
*no - Adds the Mime version header field
Output Parameters
None.
Usage Notes
*This service does not add output variables to the pipeline. Instead, it updates the contents of the existing mimeData.
*This service is not compatible with those in the pub.mime folder.
*The MIME objects that the services in the pub.mime folder creates will not work with this service.

Copyright © 2016- 2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release