cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with reading attachment in sender mail adapter

Former Member
0 Kudos

Hi, I am working on Email to file scenario, where I have to connect to exchange server and take the attachment of the email (xml file) and save it on to PI server. I have configured sender mail communication channel with following details:

Protocol: POP3

Message protocol: XIPAYLOAD

Mail attributes: keep attachments

Module:

1 localejbs/AF_Modules/PayloadSwapBean Local Enterprise Bean 1

2 localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail

1 swap.keyName Content-Description

1 swap.keyName Content-Description

1 swap.keyValue attachment,filename="MailAttachment-1.xml"

1 swap.keyValue MailAttachment-1

Also, configured receiver file adapter.

Since I donu2019t have to read mail content , I havenu2019t created any design components in ESR. I have just refrred to dummy namespace, interface (both sender and receiver). in receiver determination, interface determination, sender agreement and receiver agreements.

It was working fine, not sure what changes happened. Now I could see the attachment payload in message monitor.

Under Inbound message->payloads->

MailMessage ( text/xml;charset=utf-8 )

MailAttachment-1 ( text/xml;name="****************")

But the fille that is getting created doesnu2019t have the contents of the attachment (xml file) . It has some other information, shown below:

Directory: ******

Name: ********.xml

=NextPart_002_01CB2C5B.B033B325#

content-type:text/plain;charset="us-ascii"#

content-length:30#

content-transfer-encoding:quoted-printable#

#

<<**********.xml>>=20#

#

=NextPart_002_01CB2C5B.B033B325#

content-type:text/html;charset="us-ascii"#

content-length:#

content-transfer-encoding:quoted-printable#

#

#

=NextPart_002_01CB2C5B.B033B325 #

Can you please let me know what is going wrong here.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member200962
Active Contributor
0 Kudos
1 swap.keyName Content-Description
1 swap.keyName Content-Description
1 swap.keyValue attachment,filename="MailAttachment-1.xml"
1 swap.keyValue MailAttachment-1

Should Content-Disposition not included? Also there should be a semicolon between attachment and filename in swap. keyValue

1 swap.keyName Content-Disposition

1 swap.keyValue attachment;filename="MailAttachment-1.xml"

1 swap.keyName Content-Description

1 swap.keyValue MailAttachment-1

Former Member
0 Kudos

Hi Suresh/Abhishek,thanks for the response. I tried these options , but still file is nogetting created from xml attachment.

as i mentioned , i could see the attachment payload in monitor.

There are two payloads i could see in monitor, i could not see the contents of the first payload. But i think , file is getting created from this payload.Second payload is the xml attachment data.

do i have to create mail namespace in esr, even though i dont really need to do any mappings.

OR payload swap module is not working properly because of any parameters missing / wrongly entered.

surprisingly it was working fine few days back, not sure whether any parameters got changed...

former_member200962
Active Contributor
0 Kudos
But i think , file is getting created from this payload.Second payload is the xml attachment data.

when you use the PayloadSwapBean then the attachment goes into the mapping...the details from the attachment are considered...i think the same has been mentioned by Michal in his blog on PayloadSwapBean

/people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step

I think there is something missing in the config.

Former Member
0 Kudos

Hi Abhishek,

We have PI 7.1 EHP1. I am not able to see the default XI parameters here as mentioned by Michal.

Can you please let me know whether these parameters not reuired in this version or do i have to do smething to view these parameters .

RafaelVieira
Active Participant
0 Kudos

Hi VAMSIKRISHNA,

was this question solved?

Could you post the solution here?

I'm facing the same problems.

Not sure if my PayloadSwapBean has any problem.

Thanks,

Rafael Vieira.

Werner_Magerl
Participant
0 Kudos

Hello,

any news an that????

I am facing the same problem with the mail sender adapter PI7.11

What is confusing for me,

ist that the order of swap.keyName and swap.keyValue is allways differetn when I save the adapter.

It is not like in the blog from Michael.

Is this an PI problem????

I can see the mail content and the mail attachment in monitoring, but both are not swapped.

best regards

Werner

Former Member
0 Kudos

using following parameters in module resolved my problem:

MOdule name Type Module Key

-


AF_Modules/PayloadSwapBean Local Enterprise Bean transform sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail

Module Key Parameter Name Parameter value

-


transform swap.keyName Payload-Name

transform swap.keyName MailAttachment-1

-


Former Member
0 Kudos

Thanks for sharing this VAMSI.

I was stuck until your suggestion of using swap.keyName = "Payload-Name".

Also for the second module parameter I had to use swap.keyValue = "MailAttachment-1".

After this the payload swaps were finally successful for us.

Thanks also to Michal for blogging about this long ago.

http://scn.sap.com/people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--...

Former Member
0 Kudos

Aaron Myers, Hi!

Could explain a little more how your Module look like after the solution reported?

It was like this?

Processing Sequence:

AF_Modules/PayloadSwapBean | Local Enterprise Bean | TRANSFORM

Module Configuration:

TRANSFORM | swap.keyName  | Payload-Name

TRANSFORM | swap.keyValue | MailAttachment-1

Former Member
0 Kudos

Hi Guilherme, like that but also the second step of the adapter calling XIMailAdapterBean. Here is a screen shot:

Former Member
0 Kudos

I Guess 1 swap.keyName Content-Description is changed to 1 swap.keyName payload-name in PI 7.1

please check it.