B Handling E-Mail Attachments

This appendix discusses how Oracle B2B handles payloads by using e-mail.

The appendix contains the following sections:

B.1 Sending and Receiving Payload as an E-Mail Attachment

For inbound messages, if the e-mail body is empty, and it has a part of an e-mail attachment, then the attachment part is be treated as the payload and accordingly processed For outbound messages, you can configure the delivery channel to send the payload as an e-mail attachment. To send the payload as an attachment, you configure the delivery channel by setting Send as attachment to true.

The default e-mail body ignore size is 5 characters. If the e-mail body contains more than 5 characters, then the body is treated as a payload.

The default size to ignore can be configured using the following Oracle B2B server property in Oracle Fusion Middleware Control console:

b2b.DefaultBodySize=20 (otherwise, the default value is 5).

B.2 Sending and Receiving Payload as E-Mail Body

In the case of outbound message processing, if you want to send the payload as the e-mail body, you can configure the delivery channel by setting Send as attachment to false.

In case of inbound, in this case, the e-mail body is be treated as the payload and is accordingly processed by Oracle B2B.

B.3 Sending and Receiving Payload as E-Mail Body Along with an Attachment

In the case of outbound message processing, if you want to send the payload as an e-mail body along with an e-mail attachment, you need to configure the delivery channel by setting Send as attachment to false, and specifying the attachment in the Attachment header at the back-end application.

Example B-1 shows a single attachment.

Example B-1 Single Attachment

<?xml version="1.0" encoding="UTF-8"?>
<Attachments xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="AttachmentDescriptor.xsd" boundary="boundary----">
  <AttachmentPart>
     <Location>file:///tmp/oralogo_small.gif</Location>
     <Content-Type>
         <Top-Level-Type>image</Top-Level-Type>
         <Sub-Type>jpeg</Sub-Type>
     </Content-Type>
    <Content-Transfer-Encoding>BASE64</Content-Transfer-Encoding>
    <Content-ID/>
    <Content-Description>A GIF file</Content-Description>
</AttachmentPart>
</Attachments>

In the case of inbound, in this case, the e-mail body is treated as the payload, and the attachment is stored in the configured attachment directory. The attachment directory can be configured by setting the following Oracle B2B server property in the Oracle Fusion Middleware Control console:

b2b.attachments.dir=<directory_name>/

B.4 Sending and Receiving Payload as E-Mail Body Along with Multiple Attachments

In the case of outbound message processing, if you want to send the payload as an e-mail body along with multiple e-mail attachments, you need to configure the delivery channel by setting Send as attachment to false, and specifying the attachment in the Attachment header at the back-end application.

Example B-2 shows multiple attachments.

Example B-2 Multiple Attachments

<Attachments xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="AttachmentDescriptor.xsd" boundary="boundary----">
  <AttachmentPart>
     <Attachment>UjBsR09EbGhjZ0dTQUxNQUFBUUNBRU1tQ1p0dU1GUXhEUzhi</Attachment>
     <Content-Type>
        <Top-Level-Type>image</Top-Level-Type>
        <Sub-Type>jpeg</Sub-Type>
     </Content-Type>
     <Content-Transfer-Encoding>BASE64</Content-Transfer-Encoding>
     <Content-ID/>
     <Content-Description/>
  </AttachmentPart>
  <AttachmentPart>
      <Location>file:///tmp/SpreadSheet.xls</Location>
      <Content-Type>
        <Top-Level-Type>application</Top-Level-Type>
        <Sub-Type>vnd.ms-excel</Sub-Type>
      </Content-Type>
      <Content-Transfer-Encoding>BASE64</Content-Transfer-Encoding>
      <Content-ID>SpreadSheet-1</Content-ID>
      <Content-Description/>
  </AttachmentPart>
</Attachments>

In the case of inbound, in this case, the e-mail body is treated as the payload, and the attachments are stored in the configured attachment directory.