Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
MichalKrawczyk
Active Contributor

In some of our integration projects we may be asked to receive messages by e-mail.
It can be a simple XML message or even a large XML-IDOC. However in most cases
our message will not be a part of the e-mail's payload but will be sent as a file attachment.
Can XI's mail adapter handle such scenarios? Sure it can but with a little help
from the PayloadSwapBean adapter module. In this weblog I'll demonstrate how to configure it.



Scenario

:


We'd like to receive an XML message which will be sent as the e-mail attachment
and we'd like to process the message later on (mapping, etc).



At first we have to configure/create out mail communication channel.





Step 1






Configure your mail communication channel:



- Transport protocol: POP3


- Message Protocol: XIPAYLOAD


- since we want to use our attachment we have to receive it first:







- change the QoS from Best effort to an asynchronus one:






- don't forget to specify Default Parameters:






Step 2






Now when the e-mail message comes to our account
we should see that it was picked up by our mail adapter:




http://xiserver:port/mdt/amtServlet







If the message was picked up we can proceed further on.




Step 3






- let's open Messaging system:


http://xiserver:port/MessagingSystem/monitor/monitor.jsp






- Display message bytes


  




to see how our e-mail message looks like:




--SAP_1c3f0981-6fe8-11da-82b2-000d601c4c42_END

Content-ID:







We can see some attributes from the MIME header such
as Content-Disposition or Content-Description.

We can use them to tell our mail adapter to treat them as the main message and not the original payload.








With those values we can go back to our mail adapter and use them in the

Module

tab






  




When you configure the rest of the data inside Integration Directory and do some more tests
we should be able to see that the message which goes to our interface mapping

is actually the attachment and not the main payload itself.



  



  

22 Comments