Mail Adapter: XIALL and attachments
Hi All,
I have a scenario with Sender Mail adapter, where I need data from both the Mail and the attachment.
I tried using XIALL, but get a SAXParserException.
Is there any other way that I can use both Main Payload as well as Attachment fields?
Regards,
Puloma.
Like i mentioned only one of the two ( eithetr the attachment or the payload ) can be used as the source of your mapping.
You might have to consider another option for this.
Either use a BPM in your mapping and have duplicatre mails in your mail box. So, you can have both these attachment and the main paylaod in the different Receive step in your BPM and then have a N:1 mapping inside the BPM.
Regards
Bhavesh
Similar Messages
-
Receiver Mail Adapter - Body and Attachment
Hello All,
Based on the document How to Use the Mail Adapter of the XI 3.0 J2EE Adapter Engine section 3.2.4 says that the payload of the message is sent as the body and an attachment when the Keep Attachments checkbox is configured. By default, the payload of the message is also sent as an attachment.
In testing this feature - if it is checked I get the attachment - if it is not checked I get the payload in the body of the email. I do not get both.
I am using an xslt mapping.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:ns0="urn:sap-com:document:sap:rfc:functions" xmlns:ns="http://sap.com/xi/XI/Mail/30">
<xsl:output method="xml" encoding="utf-8" indent="no" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:apply-templates select="ORDERS02"/>
</xsl:template>
<xsl:template match="ORDERS02">
<ns:Mail>
<Subject>
<xsl:text>Sample Purchase Order: </xsl:text>
<xsl:value-of select="IDOC/E1EDK01/BELNR"/>
</Subject>
<From>
<xsl:text>mail@Com</xsl:text>
</From>
<To>
<xsl:text>mail@com</xsl:text>
</To>
<Content_Type>text/plain; charset="ISO-8859-1"</Content_Type>
<Content_Disposition>attachment; filename="order.dc"</Content_Disposition>
<Content>
<xsl:text> </xsl:text>
<xsl:value-of select="IDOC/E1EDK01/BELNR"/>
<xsl:text>A </xsl:text>
<xsl:text>ORD 238 </xsl:text>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="IDOC/E1EDP01"/>
<xsl:text> </xsl:text>
</Content>
</ns:Mail>
</xsl:template>
<xsl:template match="IDOC/E1EDP01">
<xsl:value-of select="concat(' ',/ORDERS02/IDOC/E1EDK01/BELNR)"/>
<xsl:text>Z</xsl:text>
<xsl:value-of select="substring(concat(E1EDP19[QUALF=002]/IDTNR,' '),1,7)"/>
<xsl:value-of select="format-number(number(MENGE),'00000')"/>
<xsl:text> </xsl:text>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>Thank you so much for your patience. The mapping works if I do not use the extra content_type tags. Do I need to include the Mime-Version: 1.0....also, notice the
<Content_Type>multipart/mixed; boundary="b1"</Content_Type>
Versus
<Content>--b12 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit My Order --b1
Your example shows use of Content-Type - and the XSLT sample shows <Content_Type> Do you know what the correct format is to use?.
I changed my xsl per your instructions.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="xml" encoding="utf-8" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:apply-templates select="ORDERS02"/>
</xsl:template>
<xsl:template match="ORDERS02">
<ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
<Subject>
<xsl:text>Purchase Order: </xsl:text>
</Subject>
<From>
<xsl:text>mail@com</xsl:text>
</From>
<To>
<xsl:text>mail@com</xsl:text>
</To>
<Content_Type>
<xsl:text>multipart/mixed; boundary="b1"</xsl:text>
</Content_Type>
<Content><xsl:text>--b12
</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>Content-Type: text/plain; charset=us-ascii </xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>Content-Transfer-Encoding: 7bit </xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>My Order</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>--b1</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>Content-Type: text/plain; charset=us-ascii</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>Content-Transfer-Encoding: 7bit</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>Content-Disposition: attachment; filename="order.dc"</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="IDOC/E1EDK01/BELNR"/>
<xsl:text>A </xsl:text>
<xsl:text>ORD 238 </xsl:text>
<xsl:text>
</xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="IDOC/E1EDK01/BELNR"/>
<xsl:text>B</xsl:text>
<xsl:text>The Wolf Organization </xsl:text>
<xsl:text>
</xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="IDOC/E1EDK01/BELNR"/>
<xsl:text>C</xsl:text>
<xsl:text>PO Box 2044 </xsl:text>
<xsl:text>
</xsl:text>
<xsl:text> </xsl:text>
<xsl:text>D</xsl:text>
<xsl:text>York, PA 17404-2044 </xsl:text>
<xsl:text>
</xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="IDOC/E1EDK01/BELNR"/>
<xsl:text>E</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="IDOC/E1EDK01/BELNR"/>
<xsl:text>F</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="IDOC/E1EDK01/BELNR"/>
<xsl:text>G</xsl:text>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="IDOC/E1EDP01"/>
<xsl:text> </xsl:text>
</Content>
<xsl:text>--b1--</xsl:text>
</ns:Mail>
</xsl:template>
<xsl:template match="IDOC/E1EDP01">
<xsl:text>Z</xsl:text>
<xsl:text> </xsl:text>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
Now my results look like this:
- <ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
<Subject>Purchase Order:</Subject>
<From>mail@com</From>
<To>mail@com</To>
<Content_Type>multipart/mixed; boundary="b1"</Content_Type>
<Content>--b12 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit My Order --b1 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="order.dc" 4500000185A ORD 238 4500000185BThe Wolf Organization 4500000185CPO Box 2044 DYork, PA 17404-2044 4500000185E 4500000185F 4500000185G Z Z</Content>
--b1--
</ns:Mail>
And the error is still:
Following error occurred while executing the application:
java.lang.IllegalArgumentException: can't parse argument number http://sap.com/xi/XI/Mail/30
Display Stack Trace
Stack trace for the above error message is:
java.lang.IllegalArgumentException: can't parse argument number http://sap.com/xi/XI/Mail/30
at java.text.MessageFormat.makeFormat(MessageFormat.java:1323)
at java.text.MessageFormat.applyPattern(MessageFormat.java:447)
at java.text.MessageFormat.(MessageFormat.java:347)
at java.text.MessageFormat.format(MessageFormat.java:800)
at jsp_auditlog1160053386093._jspService(jsp_auditlog1160053386093.java:274)
at com.sap.engine.services.servlets_jsp.server.jsp.JspBase.service(JspBase.java:112)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:544)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:186)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.doWork(RequestDispatcherImpl.java:316)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:372)
at com.sapportals.htmlb.page.PageProcessorServlet.handleRequest(PageProcessorServlet.java:68)
at com.sapportals.htmlb.page.PageProcessorServlet.doGet(PageProcessorServlet.java:29)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) -
Retrieval of attachment filename - receiver mail adapter
Hi,
I am using the mail adapter to receive an e-mail into PI. This e-mail has an attached CSV file.
First, I am using the PayloadSwapBean to swap the application playload to the attachment payload
Second, I am using the MessageTransformBean to transform the CSV file into an XML document
These are both working fine and the message is then passing into the relevant message mapping.
However, I would like to be able to use the attachment filename in the message mapping.
Can anyone advise how to do this for the mail adapter ?
I've done it loads of times for the file adapter but never the mail adapter (when using attachments) so I am a bit stumped.
Any advice greatly received.
Cheers
Colin.Hi Progirl,
I want to dynamically set the name of attachment in receiver mail Communication Channel.
Example: IN__9907211000004_4048454000005_20081211_01000000002643
The first two numbers 9907211000004 & 4048454000005 I want to read it from the message
20081211 this is the date and
And againg this number 01000000002643 is read from message.
I read from your response. You had created adapter module for the similar purpose. Can you share it. Since I am new to writing Adapter Module.
Thank You in Advance.
Mukhtar -
Mail Adapter ContentDisposition attachment
Hello,
We have goot a big Problem with the Mail-Adapter at PI.
The Adapter generated:
MIME-Version: 1.0
Content-ID: <mail-9674f6c0d03711de86dc00144fb7b1f0>
Content-Disposition: inline
Content-Type: multipart/mixed; boundary="AaBb--984dfgeSSd3532"
Content-Transfer-Encoding: binary
Message-ID: <MA-EX051w920foGAl6g0001065b@xxxccc>
X-OriginalArrivalTime: 13 Nov 2009 09:33:23.0294 (UTC) FILETIME=[58264FE0:01CA6444]
But we need:
MIME-Version: 1.0
Content-ID: <mail-9674f6c0d03711de86dc00144fb7b1f0>
Content-Disposition: inline
Content-Type: multipart/mixed; boundary="AaBb--984dfgeSSd3532"
Content-Transfer-Encoding: attachment
Message-ID: <MA-EX051w920foGAl6g0001065b@cccxxx>
X-OriginalArrivalTime: 13 Nov 2009 09:33:23.0294 (UTC) FILETIME=[58264FE0:01CA6444]
We use as Bean: localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
Transform.ContentDisposition attachment
Could someomene help us.
Thanks and bye bye
MarcHi Marc,
Didnt get your requirement correctly!!!
You want the payload as an attachment to mail?? If yes the in receiver mail adapter select keep attachments and choose XIPayload
Regards
Suraj -
MAIL Adapter Error..........
Hi all,
I am getting an error in sender MAIL adapter configuration in communication channel monitering.
"<b>exception caught during processing mail message; java.io.IOException: unexpected greeting response; read 220 tn6tdc00.wdf.sap.corp SAP 7.00(52) ESMTP service ready"</b>
Can anybody tell me why this error is coming and how to resolve it.
Thanks,
Shiv Prashant DixitHi,
Please check your URL what you used.. in MAIL Adapter configured and port ,(SMTP Configurations..)
See the following threads
Mail-XI-file scenario
Email Adapter Throwing Error
Error during configuration of Sender Mail Adapter
http://help.sap.com/saphelp_nw04/helpdata/en/ad/bf93409c663228e10000000a1550b0/frameset.htm
Regards
Chilla.. -
Configuring Mail Adapter as sender
Hello,
I'd like to ask for some help with configuration of SAP XI mail adapter as sender. I made a communication chanel with mail adapter type and specified transport protocol POP3, URL (pop3://localhost), user, password and poll interval. The problem is that XI doesn't trigger the
process, in other words it doesn't connect to my email server to receive the mail. What could be wrong? To test the environment, I made a test case withmail adapter as a receiver - and it works ok - it sends mail via my email server - so SMTP is working fine.
Thank you,
Igor> I'd like to ask for some help with configuration of
> SAP XI mail adapter as sender. I made a communication
> chanel with mail adapter type and specified transport
> protocol POP3, URL (pop3://localhost), user, password
> and poll interval.
The correct URL is: pop://localhost
Which Mail-Server do you use?
Regards
Stefan -
Sender Mail Adapter Configuration - Process Multiple Attachments
Dear sirs,
I need to process several attachments at the same mail message as individual payloads.
In default configuration of sender mail adapter only the body of message is used as payload.
So I added PayloadSwapBean Module at Processing Sequence and it processed the attachment I set in Module Configuration. I'm not able to process all attachments available, just one attachment is sent to PI pipeline.
How can I process all attachments of a single mail message?
Thank you in advance.
Fabio PurcinoHi Jose,
We are trying to implement reading multiple attachment in sender mail adapter.
Our Requirement is : Reading a mail having multiple .xls files. This should be read and converted to payload .
package multiswap;
//import com.sap.aii.adapter.xi.ms.XIMessage;
import com.sap.aii.af.lib.mp.module.*;
import com.sap.aii.af.lib.trace.Trace;
import com.sap.aii.af.sdk.xi.mo.Message;
import com.sap.aii.af.sdk.xi.mo.MessageContext;
import com.sap.aii.af.sdk.xi.mo.xmb.XMBMessageOperator;
import com.sap.aii.af.sdk.xi.mo.xmb.XMBPayload;
import com.sap.aii.af.sdk.xi.util.PayloadType;
import com.sap.aii.af.service.auditlog.Audit;
import com.sap.aii.af.service.cpa.*;
import com.sap.engine.interfaces.messaging.api.MessageDirection;
import com.sap.engine.interfaces.messaging.api.MessageKey;
import com.sap.engine.interfaces.messaging.api.Payload;
import com.sap.engine.interfaces.messaging.api.auditlog.AuditLogStatus;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Locale;
import javax.ejb.*;
public class MultiSwapRead
implements SessionBean, Module
private static final String VERSION_ID = "$Id: //tc/xpi.af/NW731EXT_07_REL/src/_af_application_ejb_module/ejbm/api/com/sap" +
"/aii/af/app/modules/PayloadSwapBean.java#1 $"
private static final Trace TRACE = new Trace("$Id: //tc/xpi.af/NW731EXT_07_REL/src/_af_application_ejb_module/ejbm/api/com/sap" +
"/aii/af/app/modules/PayloadSwapBean.java#1 $"
private static final String SIGNATURE_PROCESS = "process(ModuleContext , ModuleData)";
protected Hashtable cachedChannels;
protected SessionContext myContext;
public MultiSwapRead()
cachedChannels = new Hashtable();
public void ejbRemove()
public void ejbActivate()
public void ejbPassivate()
public void setSessionContext(SessionContext context)
myContext = context;
public void ejbCreate()
throws CreateException
public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData)
throws ModuleException
if(TRACE.beLogged(200))
TRACE.entering("process(ModuleContext , ModuleData)", new Object[] {
moduleContext, inputModuleData
ModuleData outputModuleData;
Iterator itr;
outputModuleData = inputModuleData;
String chid = moduleContext.getChannelID();
TRACE.infoT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, (new StringBuilder()).append("performing payload swap for channel ").append(chid).toString());
LookupManager lman = LookupManager.getInstance();
Channel chan = null;
try {
chan = (Channel)LookupManager.getInstance().getCPAObject(CPAObjectType.CHANNEL, chid);
} catch (CPAObjectNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (CPAException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
Direction direction = chan.getDirection();
String swapkey = moduleContext.getContextData("swap.keyName");
String keyvalue = moduleContext.getContextData("swap.keyValue");
Object obj = inputModuleData.getPrincipalData();
Object pivotedObj = inputModuleData.getSupplementalData("mp.pivoted");
boolean pivoted = pivotedObj == null || !(pivotedObj instanceof Boolean) ? false : ((Boolean)pivotedObj).booleanValue();
Message mo = null;
if(obj instanceof com.sap.engine.interfaces.messaging.api.Message)
mo = (Message)((com.sap.engine.interfaces.messaging.api.Message)obj);
} else
if(obj instanceof MessageContext)
mo = ((MessageContext)obj).getMessage();
} else
TRACE.warningT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, "no message found");
if(mo != null && XMBMessageOperator.numberOfPayloads(mo) > 0)
// String midstr = XMBMessageOperator.getMessageId(mo).toString();
MessageKey auditkey = new MessageKey(((com.sap.engine.interfaces.messaging.api.Message) mo).getMessageId(), com.sap.engine.interfaces.messaging.api.MessageDirection.INBOUND);
itr = (Iterator) mo.getAttachments();
if(swapkey != null && keyvalue != null)
StringBuffer textSwappingbyBuf = new StringBuffer();
textSwappingbyBuf.append("Swap: swapping by '").append(swapkey).append("' ? '").append(keyvalue).append("'");
String textSwappingby = textSwappingbyBuf.toString();
TRACE.infoT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, textSwappingby);
Audit.addAuditLogEntry(auditkey, AuditLogStatus.SUCCESS, textSwappingby);
while (itr.hasNext()){
boolean swappedp = swapPayloads(mo, swapkey, keyvalue);
String swappedStatus = swappedp ? "Swap: successfully swapped" : "Swap: no matching payload found";
Audit.addAuditLogEntry(auditkey, AuditLogStatus.SUCCESS, swappedStatus);
} else
StringBuffer textInvalidBuf = new StringBuffer();
textInvalidBuf.append("Swap: parameter missing ");
if(swapkey == null)
textInvalidBuf.append("swap.keyName");
if(swapkey == null && keyvalue == null)
textInvalidBuf.append(" and ");
if(keyvalue == null)
textInvalidBuf.append("swap.keyValue");
String textInvalid = textInvalidBuf.toString();
TRACE.warningT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, textInvalid);
Audit.addAuditLogEntry(auditkey, AuditLogStatus.WARNING, textInvalid);
} else
String messageEmpty = "Swap: message is empty or has no payload";
TRACE.infoT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, messageEmpty);
return outputModuleData;
private static boolean swapPayloads(Message mo, String swapkey, String keyvalue)
swapkey = swapkey.toUpperCase(Locale.ENGLISH);
keyvalue = keyvalue.toUpperCase(Locale.ENGLISH);
int ifound = -1;
for(int i = 0; i < XMBMessageOperator.numberOfPayloads(mo); i++)
XMBPayload pldi = XMBMessageOperator.getPayload(mo, i);
String pldivalue = null;
if(swapkey.equals("PAYLOAD-DESCRIPTION"))
pldivalue = pldi.getPayloadDescription();
} else
if(swapkey.equals("PAYLOAD-NAME"))
pldivalue = pldi.getPayloadName();
} else
pldivalue = pldi.getContentAttribute(swapkey);
if(pldivalue == null)
continue;
pldivalue = pldivalue.toUpperCase(Locale.ENGLISH);
if(pldivalue.indexOf(keyvalue) < 0)
continue;
ifound = i;
break;
if(ifound >= 0)
XMBPayload pldfound = XMBMessageOperator.getPayload(mo, ifound);
if(pldfound.getPayloadType() != PayloadType.APPLICATION)
XMBPayload pldapp = XMBMessageOperator.getApplicationPayload(mo);
if(pldapp == null)
pldfound.setPayloadType(PayloadType.APPLICATION);
} else
pldapp.setPayloadType(PayloadType.APPLICATION_ATTACHMENT);
pldfound.setPayloadType(PayloadType.APPLICATION);
TRACE.infoT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, "successfully swapped");
return true;
} else
TRACE.warningT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, "no matching found");
return false;
We couldn't go further. Please have a look in highlighted code.
Regards,
Kesava. -
How to handle Multiple attachments in sender Mail Adapter
Hi,
In our requirement is mutiple documents send through mail adapter, In custom java module we read the each document details and do it bussiness process. But now i am not able to read the multiple files at a time. we are able to read single file only. So plz give the solution for that.
1) How to send multiple attachments(like word, PDF, JPG etc..) using mail apapter.
2) How to read multiple attachments in custom java module.
Thanks & Regards
VijayHi Vijay,
Go through this weblog this explains steps to multile attachments.
/people/sravya.talanki2/blog/2006/01/12/xi-triggering-e-mails-with-multiple-attachments--problems
Regards,
Ashwin. -
Rename the zip file and send it using the Receiver Mail Adapter
Hi,
We have a custom module that will create multiple attachments. The result is then passed to the PayloadZipBean, which zips as per required.
When we output this to a file adapter, we provide the file name as say "zippedfile.zip" the result is as expected.
For example, if the custom module created 3 attachments with the names as file1.txt, file2.txt and file3.txt, the zip file zippedfile.zip, will contain 3 files as file1.txt, file2.txt and file3.txt.
The issue that we are facing is when we use the mail adapter, the zip file is getting renamed to file1.txt.zip i.e to say that it takes the name of the main payload from the custom module (file1.txt)
TextPayload txtpayload = message.getDocument();
txtpayload.setContentType("text/plain");
txtpayload.setName("file1.txt");
moduleData.setPrincipalData(message);
We tried using the MessageTransformbean but it doesn't seem to change the name of the file.
Not sure where we are going wrong. Is it that the output of the payloadzipbean cannot be used and altered by MessageTransformbean?
Is there any alternative as to rename the name of zipfiles and use it in the mail adapter?
Appreciate any help on this regard.
Regards,
ShabzSolved.
use Transform.ContentDisposition - attachment;filename="youfilename"
Do read the mail adapter FAQ.
The parameter can vary for different mail client. -
Read multi-tabbed excel file attachments from Sender Mail Adapter.
There is a need to read excel attachments from incoming email to a
mailbox. We know we can use Sender Mail adapter to easily read .xml, .txt
or .csv attachments.
For excel attachments we know from SDN that you have to write
adapter modules to handle excel. However the excel file we need to read has
multiple worksheets(tabs) and data may be contained in any of them.
Is it possible to use SAP XI Mailsender adapter to read such a file as an attachment? What kind of module development would we need for this? I am not much of a Java programmer so examples or links to other documentation would help.
Thanks,
RudraRudra,
Use Java Mapping. There is a free java api available called JExcelAPI to achieve this.
Shabarish's blog describes about this. This might be helpful to you
/people/shabarish.vijayakumar/blog/2009/04/05/excel-files--how-to-handle-them-in-sap-xipi-the-alternatives -
Query related to multiple attachments in mail adapter
Hi,
I have a query related to multiple attachments in receiver mail adapter.
I have successfully configured mail related scenarios but now I have another requirement in which I have multiple source files in one directory and I want to send one mail for multiple files as mail attachment using receiver mail adapter. Can anybody help me how to achieve multiple attachments in reciever mail adapter.
To clarify the requirement more let us take an example
Ex: I have 5 input files in the source which I pick up using additional files option in the sender file adapter, now I want to send those 5 files into one mail with 5 attachments. Can anybody explain how 5 different payload will be sent as multiple attachments in one mail.
For your information I used, options like "keep attachments" , some parameters in module processesors etcs...but not able to find out as how exactly it will be achieved.......I dont want to use BPM collect pattern for this.....
Need your help on this issue. Please suggest the solution as how it can be achieved using receiver mail adapter.
Thanks & Regards
PrabhatHi,
I resolved the issue on my own. Thanks for your help and support.
Thanks & Regards
Prabhat -
Mail Adapter to Soap Adapter keeping the attachments - How?
Hi guys,
I am working on a scenario where I should pull emails from an Exchange server and I should forward them (with their attachments) to a separate systems via a Web Service.
So far I have been able to pull the emails using the Mail Adapter and I get to see them in the monitoring tool of PI with their attachment(s). But what I am not sure of is how I should forward these emails to the external system using a web service.
This system should expose this web service that should use something similar to SOAP with attachments (I guess) and then PI should forward these attachments using the receiver SOAP adapter with the "keep attachments" option selected.
Is this something that could work as simply as this (by configuring these two adapters to keep their attachments) OR will I need to do some more fancy stuff?
Thanks for any advice you can give me on this.
AldoHi Stefan,
thanks for your replay.
Yes, I understand that the mail should be in an XML message. And with that part we are doing OK. We have managed to send the XML between the systems.
However, what I don't understand is how to pass the attachments.
How should the receiving system receive them? if they are not in the XML message itself how are these going to be passed over?
Will the SOAP envelop have some kind of link or reference to the attachments?
The receiving system is a SAP CE system and it's based on Java. Can they expose a service that will somehow handle these attachments?
Could you explain this part to us? this is where we get confused.
Thanks for your help in advance,
Aldo -
Plain text and attachment in Mail Adapter (Receiver)
Hello,
we have to generate a mail in the mail-adapter with a specific text and an attachment.
The attachment is a document in pdf-format, that is generated inside an adapter-module out of the payload-document.
An additional text has to be added to the mail for the receiver in plain-text-format, like "Dear customer ... enclosed you will find ...".
Is it possible to mix plain-text and attachments in the mail adapter? Does anybody know how we can do that?
Regards,
ThorstenHi,
yes you can do it very easily inside the adapter module
if you're already using the adapter module then
you can just enhance it a little bit
you can add the pdf to the attachment section and
leave dear customer in the standard payload
you can even make it a little bit more dynamic
and create a module that will take the input from
the communication channel config (modules tab) - for example xml tag name in which you will specify
the dear customer (or any other text) and after this
the pdf creating can use the xml without this tag...
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a> -
Receiver mail Adapter Rename Attachments
Hi Experts,
In an Proxy --> XI --> Mail scenario, how do I configure the Mail Receiver Adapter to rename attachments?
There is a PDF file and a DOC file that the Proxy is sendign to PI and I can see them in the payload with filenames file1.pdf and file2.doc
How do I configure the Mail receiver adapter to send them as attachments retaining the same filenames? Can I atleast assign any other name to the files?
Any method other than writing own Adapter Module?
Regards,
ShobhitHi Shobhit
If the attachment name is not dynamic (like timestamp) etc then you can use MessageTransformBean to change the attachment name at Mail adapter level.
Transform.ContentDisposition attachment;filename ="yourfilename.extension"
Transform.ContentDescription attachment name
Transform.ContentType your type like text/plain or application/pdf.
If you are using Mail package then you can set the attachment name from mapping itself.(here even Timestamp and Dynamic values work)
Thanks
Gaurav -
Handling multiple xls , xlsx attachments in mail adapter
We have a (sender)mail with excel attachment scenario which is converted to an Idoc.
Currently we are using ''PayloadSwapBean" for converting .xls attachment as main payload which is being read using an adapter module.
PFA the screenshot.
We have a new requirement as below
when there are additional attachments in e-mail only the relevant template (MS Excel file) loaded.
Handle all MS Excel format: .XLSX in addition to existing .XLS
ability to process multiple excel file in a mail
Kindly suggest ways to handle it.
Regards,
KesavaCould you please provide the location of PayloadSwapBean file (.Ear,.jar,.class and also provide AL11) Transaction in PI 7.31.
Brief Background:
We have a requirement to read multiple attachment from mail adapter. PayloadSwapBean is capable of reading only single attachment. We would like to see the code of PayloadSwapBean and modify accordingly to meet the requirement.
If there is any alternative could please suggest the solution for read the multiple attachments in sender mail adapter.
Maybe you are looking for
-
Why does iTunes make a mess out of my TV Shows library?
I'm not really sure where to post this, as it doesn't seem like Apple pays much attention to the official Apple Support Forums, but I'll give it a go nontheless. The thing is, as most Apple TV owners I have to rely on iTunes for handling my media lib
-
Old iphone3 photo albums not showing in iphoto and I want to import them
I found my old iphone3 today and discovered a heap of photos on there that we lost years ago when our hard drive died. I'm very keen to get these photos onto the computer and of course then back them up onto an external drive! When I plug the phone i
-
Exposing and Consuming web service using NWDS
Hi all, I want to expose and consume a webservice using NWDS. My java application will interact with the SAP web service to create materials in r3. I just want to know how to create a EJB project that contains the Web service and deploy on the SAP WA
-
I need information on a name change. << Message was moved to a new thread by: Verizon Moderator >>
-
Run InDesign 5.5 in 64 bit?
I was looking at Activity Monitor when I noticed that Photoshop was 64 bit, but Indesgn was not. Is there something I need to change to run in 64 bit? Or am i mising something? I'm running: MacPro5,1 Mac OS X 10.6.8 Processor Name: 6-Core In