Step by Step Mail to File Scenario

17
Step by Step Mail To File Scenario Skip to end of metadata Attachments:37 Added by Guest, last edited by Kenny Scott on Jun 28, 2011 (view change ) show comment Go to start of metadata Scenario1: Mail to File Scenario using the Transport Protocol as POP3 The first scenario that i am explaining is sending the file as an attachent in the mail.The mail adapter will read the attached file, do the transformation and create the file in the target directory. The mail adapter is using the trasport protocol as POP3 this protocol is used to read the mail from the inbox of the mail server and delete the file after reading the mail. Design Objects: Data Types: Create the two Data Types, one for the source and other for the target side. Source Data Type: The source data type contains the following fields Subject,From,To ,Input1 and Input2 as shown below. Fig1. Source Data Type Target Data Type: Fig2.Target Data Type

description

Step by Step Mail to File Scenario

Transcript of Step by Step Mail to File Scenario

Step by Step Mail To File Scenario

Skip to end of metadata

Attachments:37

Added by Guest, last edited by Kenny Scott on Jun 28, 2011  (view change)

show comment

Go to start of metadata

Scenario1: Mail to File Scenario using the Transport Protocol as POP3

The first scenario that i am explaining is sending the file as an attachent in the mail.The mail adapter will read the attached file, do the transformation and create

the file in the target directory.

The mail adapter is using the trasport protocol as POP3 this protocol is used to read the mail from the inbox of the mail server and delete the file after reading the

mail.

Design Objects:

Data Types:

Create the two Data Types, one for the source and other for the target side.

Source Data Type:

The source data type contains the following fields Subject,From,To ,Input1 and Input2 as shown below.

Fig1. Source Data Type

Target Data Type:

Fig2.Target Data Type

Message Types:

Create the Message Type for both the data types as shown below.

Sourec Message Type:

Fig3. Source Message Type  

Target Message Type:

Fig4. Target Message Type    

Message Interfaces:

Create the Message Interfaces for the above message types as shown below.

Outbound Message Interface:

Fig5. Outbound Message Interfcae

Inbound Message Interface:

Fig6. Inbound Message Interface

Message Mapping:

Create the Message Mapping between the source message type and the target message type as shown below. 

Fig7. Message Mapping

Interface Mapping:

Create the Interface Mapping between the outbound and inbound interface as shwon below.

Fig8. Interface Mapping  

Directory Objects:

Create the Business Scenario and create the sender business service and receiver business service .

Sender Communication Channel:

Create the sender communication channel of Adapter type as Mail.

select the Tranport Protocol as POP3, the POP3 transport protocol read the mails from the inbox of the mail server and delete the mail after reading.

the url field contains the url addres of the mail server.  

Fig9. Sender Communication Channel

Note: since we are reading the file as an  attachment, so we have to click on the checkbox "Keep Attachments" option as shown above.

Module Tab Parameters:

since in this scenario the file is sending as an an attachment in the mail so to read that attached file we have to use the standard module payload swap bean. 

Fig10. Module Tab Parameters

Receiver Communication Channel:

 Create the Receiver communication channel of Adapter type as File. 

Fig11. Receiver Communication Channel

Sender Agreement:

Create the Sender Agreement as shown below.

Fig12. Sender Agreement

Receiver Determination:

Create the Receiver Determination as shown below.

Fig13. Receiver Determination

Interface Determination:

Create the Interface Determination as shown below.

Fig14. Interface Determination  

Receiver Agreement:

Create the Receiver Agreement as shown below.

Fig15. Receiver Agreement  

Test the Scenario:

To Test the scenario send the mail in your mailbox as an attached file as shown in screen shot below. 

Fig16. Mail in the Inbox 

When the Mail Adapter will ping to the Mail server mail will be deleted from the inbox after reading and the file will be created in the specified directory of the

server.

The content of the output file after executing the scenario is shown below. 

Fig17. Ouput File in server directory 

If you see the output file the value of INPUT1 is now 20 and the value of the INPUT2 is now 40. so the mapping is performed well as per the message mapping

program. 

Message in SXMB_MONI is shown below. 

   

Fig18. Message in SXMB_MONI 

Scenario2: Mail to File Scenario using the Transport Protocol as IMP4:

In this scenario the mail adapter is using the IMP4 as transport protocol , this protocol is used to read the file from the personl folder of the mail server and mark

the mail as unread after reading. 

Design Objects:

use the same Design objects as used in the above scenario. 

Directory Objects:

Sender Communication Channel:

Create the sender communication channel of Adapter type as Mail.

select the Tranport Protocol as IMAP4, the IMAP4 transport protocol read the mails from the personal folder of the mail server and mark the mail as unread.

the url field contains the url addres of the mail server.

the url is of the form:

imap://server address/IMAP

Fig1. Sender Communication Channel

Note:

since we are reading the file as an  attachment, so we have to click on the checkbox "Keep Attachments" option as shown above.  

you can also delete/archive the mail after reding the mail from the personal folder.For this option to enable click on the check box "Delete Message Once

Read". when you click on the check box provide the folder name, so after reading the mail from the personal folder of the mail server the mail will be moved to

the that folder. so you can archive your all mails during processing.

Module Tab Parameters:

since in this scenario the file is sending as an an attachment in the mail so to read that attached file we have to use the standard module payload swap bean.

Fig2. Module Tab Parameters

Receiver Communication Channel:

Create the same Receiver communicationchannel as craeted i the previous scenario.

Sender Agreement:

Fig3. Sender Agreement 

Receiver Determination:

  

Fig4. Receiver Determination 

Interface Determination:

Fig5. Interface Determination

  

Receiver Agreement:

  

Fig6. Receiver Agreement 

Test the Scenario:

To Test the scenario send the mail in the mailbox as an attached file  and move the mail to the personal folder of the server as shown below. 

Remember the mail must be unread, because when the mail adapter read the mail from the Personal Folder then it will read only the unread mail. 

Fig7. Mail in the Inbox 

When the Mail Adapter will ping to the Mail server mail will be marked as read from the personal Folder as shown below. 

Fig8.  

The content of the output file after executing the scenario is shown below. 

Fig9. Output File in the server Directory 

If you see the output file the value of INPUT1 is now 20 and the value of the INPUT2 is now 40. so the mapping is performed well as per the message mapping

program. 

Message in SXMB_MONI is shown below.