background image

Messages with Attachments

<< Messages with No Attachments | SAAJ and DOM >>
<< Messages with No Attachments | SAAJ and DOM >>
M
ESSAGES
121
Figure 5­2
SOAPMessage
Object with Two
AttachmentPart
Objects
The SAAJ API provides the
AttachmentPart
class to represent an attachment
part of a SOAP message. A
SOAPMessage
object automatically has a
SOAPPart
object and its required subelements, but because
AttachmentPart
objects are
optional, you must create and add them yourself. The tutorial section walks you
through creating and populating messages with and without attachment parts.