MIME was originally developed for sending attachments with email messages. This is because SMTP, the underlying transport protocol for email messages, was incapable of carrying attachments. SMTP supports 7-bit ASCII text with a maximum capacity of one thousand characters, which is insufficient for an attachment. MIME addressed this limitation by splitting the attachment into multiple parts, or multiparts, and specifying message headers for each multipart. Attachments could then be included in the message body in the form of a MIME multipart. In SwA, MIME multipart is used to encapsulate attachments and package them with the SOAP message.
The code example demonstrates an attachment, which is packaged into a SOAP message as a MIME multipart. In a multipart header, Content-Type and Content-Transfer-Encoding specify the type and encoding style of the part, respectively. The Content-id identifies and references that part.
DIME is also used to send attachments in a SOAP message. However, DIME improves over MIME in several ways. In DIME, there is no need to encode binary data because DIME specifies the data length and type in the headers. Secondly, DIME processes messages faster and more efficiently. Unlike MIME, DIME uses data record lengths instead of separator strings to separate message parts. The parser then checks the data in the record headers to estimate the number of records in the message without having to read any record data.
In addition, there is no restriction on the content of a DIME record. While MIME limits its content-type specification to “text/html”, DIME supports both MIME content-type and those specified with the URI mechanism.
|