cancel
Showing results for 
Search instead for 
Did you mean: 

Email sender adapter configuration for 2 attachments

AntonioSanz
Active Participant
0 Kudos

Hi all,

I have to configure emal sender adapter for receiving 2 attachments. I have done next:

In Module properties of email adapter:

1.- AF_Modules/PayloadSwapBean with properties for first attachment

2.- AF_Modules/PayloadSwapBean with properties for second attachment

3.- AF_Modules/DynamicConfigurationBean with his properties

4.- sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean

Then I have a mapping from the email message to a custom interface (1 to 0..unbounded) and I tried to collect the data from the attachment, process them and generate 2 interfaces, one per each attachment.

But I get this error:

Use case DUPLICATE_CONTENT_IDS not recognized

Any Idea?

The email I've got is:

- <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

- <SOAP:Header>
- <sap:Main xmlns:sap="http://sap.com/xi/XI/Message/30" versionMajor="3" versionMinor="1" SOAP:mustUnderstand="1">

<sap:MessageClass>ApplicationMessage</sap:MessageClass>

<sap:ProcessingMode>asynchronous</sap:ProcessingMode>

<sap:MessageId>63e8b502-f5aa-11e1-a0b7-0000006386b6</sap:MessageId>

<sap:TimeSent>2012-09-03T09:33:16Z</sap:TimeSent>

- <sap:Sender>

<sap:Party agency="http://sap.com/xi/XI" scheme="XIParty" />

<sap:Service>BS_SISTEMA_GENERICO_EMAIL</sap:Service>

</sap:Sender>

<sap:Interface namespace="http://cofares.es/xi/FARMAVENIX">SI_EMAIL_OUT</sap:Interface>

</sap:Main>

- <sap:ReliableMessaging xmlns:sap="http://sap.com/xi/XI/Message/30" SOAP:mustUnderstand="1">

<sap:QualityOfService>ExactlyOnce</sap:QualityOfService>

</sap:ReliableMessaging>

- <sap:DynamicConfiguration xmlns:sap="http://sap.com/xi/XI/Message/30" SOAP:mustUnderstand="1">

<sap:Record namespace="http://sap.com/xi/XI/Message/30/general" name="senderAgreementGUID">c663ae3ff6a23da79340f3a1a55c9d76</sap:Record>

</sap:DynamicConfiguration>

- <sap:System xmlns:sap="http://sap.com/xi/XI/Message/30" SOAP:mustUnderstand="1">

<sap:Record namespace="http://sap.com/xi/XI/Message/30/general" name="senderAgreementGUID">c663ae3ff6a23da79340f3a1a55c9d76</sap:Record>

</sap:System>

- <sap:HopList xmlns:sap="http://sap.com/xi/XI/Message/30" SOAP:mustUnderstand="1">

- <sap:Hop timeStamp="2012-09-03T09:33:16Z" wasRead="false">

<sap:Engine type="AE">af.piq.caliope</sap:Engine>

<sap:Adapter namespace="http://sap.com/xi/XI/System">XIRA</sap:Adapter>

<sap:MessageId>63e8b502-f5aa-11e1-a0b7-0000006386b6</sap:MessageId>

</sap:Hop>

</sap:HopList>

</SOAP:Header>

- <SOAP:Body>

- <sap:Manifest xmlns:sap="http://sap.com/xi/XI/Message/30" xmlns:xlink="http://www.w3.org/1999/xlink">

- <sap:Payload xlink:type="simple" xlink:href="cid:payload-63e8e83cf5aa11e181e70000006386b6@sap.com">

<sap:Name>MailMessage</sap:Name>

<sap:Description>mail message</sap:Description>

<sap:Type>Application</sap:Type>

</sap:Payload>

- <sap:Payload xlink:type="simple" xlink:href="cid:payload-63e8e83df5aa11e1cacc0000006386b6@sap.com">

<sap:Name>MailAttachment-1</sap:Name>

<sap:Description>mail attachment</sap:Description>

<sap:Type>ApplicationAttachment</sap:Type>

</sap:Payload>

- <sap:Payload xlink:type="simple" xlink:href="cid:payload-63e8e83ef5aa11e185980000006386b6@sap.com">

<sap:Name>MailAttachment-2</sap:Name>

<sap:Description>mail attachment</sap:Description>

<sap:Type>ApplicationAttachment</sap:Type>

</sap:Payload>

</sap:Manifest>

</SOAP:Body>

</SOAP:Envelope>

Accepted Solutions (0)

Answers (1)

Answers (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

AFAIK you cannot put attachments in one payload

so what you can is this:

send:

a) send this e-mail (without the swaping) to two receivers

and in each of the respective mappings get the data from the attachment in the mapping 

http://scn.sap.com/people/yugapreetha.t/blog/2009/08/24/read-the-attachments-of-the-input-xi-message...

and send it to the receiver

b) inside your own adapter module you can do the split yourself (and send two messages from one e-mail) - this requires adapter module development and it's not supported by SAP (splitting in the adapter module) but it works too...

Regards,

Michal Krawczyk

AntonioSanz
Active Participant
0 Kudos

Thanks Michal, I probably go for the a) option, but how can I get the files?

I mean, I don´t know the name of the file they are sending to me. I just use a UDF funciont to get the attachment. I have tested it with an email and 2 attachment and sometimes it takes first attachment, and sometimes the second one.

Attachment attachment = inputAttachments.getAttachment(id);

I have check in the adapter that both messages has the same id

payload-d3cdf9a5f5c811e1bd4e0000006386b6@sap.com

So I am not sure how inputAttachments.getAttachment(id); is working

Can you help me?

Thanks