Trading Networks 10.7 | Administering and Monitoring B2B Transactions | Trading Networks Built-In Services Reference | Mime Folder | Using the MIME Services to Receive MIME Objects
 
Using the MIME Services to Receive MIME Objects
This section describes how to use the services in the wm.tn.mime folder to receive a MIME message and process the received MIME message.
When you receive a MIME message that you need to parse, use the digest that wm.tn.mime:writeToStream computes. You specify the parameters for computing the digest in the input parameters to the wm.tn.mime:writeToStream service.
The following are basic steps to follow to receive a MIME message:
1. Invoke wm.tn.mime:createMimeData to parse the InputStream into a MIME object.
2. Process the message, if necessary:
*If the MIME object is encrypted, invoke wm.tn.mime:processEncryptedData to decrypt the data.
*If the MIME object is signed, invoke wm.tn.mime:processSignedData to verify the digital signature.
Note:
To create digests of specified body parts rather than the entire MIME message, invoke wm.tn.mime:getBodyPartContent rather than processing the document.
3. Invoke wm.tn.mime:writeToStream to write the MIME object. If you processed the document (decrypted or verified the digital signature), specify the processed message as the MIME object to write.
If you want to compute the message digest of the document, be sure to set the input variable createDigest of the wm.tn.mime:writeToStream service to yes.