Trading Networks 10.7 | Building Services with Trading Networks | Mime Folder | Using the MIME Services to Send MIME Messages You Create
 
Using the MIME Services to Send MIME Messages You Create
This section describes how to use the services in the wm.tn.mime folder to send a MIME message that you have created.
When you send a MIME message, the MIME message is one that you have created. When working with a MIME message that you create, use the wm.tn.mime:setDigestAlgorithm service to specify that you want to compute a message digest and to set the parameters for computing the digest. Use the wm.tn.mime:getDigest to retrieve the computed message digests.
The following are basic steps to follow to send a MIME message:
1. After creating the MIME objects that represent the message you want to send, invoke the wm.tn.mime:setDigestAlgorithm for each body part for which you want to create a message digest.
2. To encrypt and/or sign a body part, use one of the following services: wm.tn.mime:createSignedAndEncryptedData, wm.tn.mime:createEncryptedData, or wm.tn.mime:createSignedData.
3. Invoke wm.tn.mime:writeToStream to write the top-level MIME object to stream, all contained MIME objects, and to compute the message digests that you requested in Using the MIME Services to Send MIME Messages You Create. If you signed a body part, wm.tn.mime:writeToStream only creates a message digest for the signed data of the body part.
4. To retrieve the message digests for the body parts that you requested, invoke wm.tn.mime:getDigest for each body part