cancel
Showing results for 
Search instead for 
Did you mean: 

Need original filename as attachment name problem

Former Member
0 Kudos

Hello!

I have a scenarion, where i read mails via Mail Adapter from a Mailbox and write the attached file (binary, e.g. .pdf) to disk. But, i Need the original filename of the mail attachment! How can i achieve this? I tried a lot of things; even writing UDFs, but i could not figure out, where the original attachment Name is stored, so i was not able to store the Name in a dynamic configuration key, to fetch it in the file Adapter!

I tried this:

BUT, this makes problems with the multipart header bean ... it gives a SOAP error, when parsing the document! Did anybody get this to work?

This is the error:

SOAPFault empfangen vom Integration Server. ErrorCode/Category: XIProtocol/WRONG_VALUE; Params: SOAP:Envelope(1)SOAP:Header(1)sap:DynamicConfiguration(3)sap:Record(2), attachment; filename="=?iso-8859-1?Q?Preisliste=5FZertifizierungsgeb=C3=BChren=5Fbrutto=5Fnetto?==?iso-8859-1?Q?=5F2014.pdf?="; size=27653;creation-date="Tue, 08 Jul 2014 13:32:58 GMT";modification-date="Tue, 08 Jul 2014 13:32:58 GMT", ST: ST_XMS_MSGHDR30_DYNAMIC; AdditionalText: An error occurred when deserializing in the simple transformation program ST_XMS_MSGHDR30_DYNAMIC; ApplicationFaultMessage: null; ErrorStack: XML tag SOAP:Envelope(1)SOAP:Header(1)sap:DynamicConfiguration(3)sap:Record(2) (or one of the attributes) has incorrect value attachment; filename="=?iso-8859-1?Q?Preisliste=5FZertifizierungsgeb=C3=BChren=5Fbrutto=5Fnetto?==?iso-8859-1?Q?=5F2014.pdf?="; size=27653;creation-date="Tue, 08 Jul 2014 13:32:58 GMT";modification-date="Tue, 08 Jul 2014 13:32:58 GMT" An error occurred when deserializing in the simple transformation program ST_XMS_MSGHDR30_DYNAMIC Data loss occurred when converting attachment; filename="=?iso-8859-1?Q?Preisliste=5FZertifizierungsgeb=C3=BChren=5Fbrutto=5Fnetto?==?iso-8859-1?Q?=5F2014.pdf?="; size=27653;creation-date="Tue, 08 Jul 2014 13:32:58 GMT";modification-date="Tue, 08 Jul 2014 13:32:58 GMT"

Does anybody have an idea, how to solve this?

BR, EF

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member191435
Contributor
0 Kudos

Hi,

Can you please try as per the below link

http://scn.sap.com/thread/3190504  

After XML use dynamic config....

Thanks,

Sreenivas

Former Member
0 Kudos

Hello!

I just want to store the attachment with the original filename! I don't transform the files into XML or anything else The file itself is ok, only the filename is not the original one ...

Any other ideas?

BR, EF

Former Member
0 Kudos

Hi Elmar,

You can try using ASMAs in the receiver file adapter. To do this, select the checkbox against File Name in the Adapter Specific Message Attributes in receiver file adapter. Save, activate and test your scenario.

If this does not work yet, then you need to use a Java mapping program that reads the attachment name and adds it to the Dynamic Configuration section of SOAP header. You can write the filename to Dynamic Configuration using message.setMessageProperty() method. Select ASMA in advanced properties and select File Name checkbox in the receiver adapter.

Regards,

Ramesh

iaki_vila
Active Contributor
0 Kudos

Hi Elmar,

Could you share your configuration, exception and your PI version?

Regards.

Former Member
0 Kudos

Hi!

We are on PI 7.40. The configuration is simple Mail Sender Adapter -> Mapping (does nothing, just for process functionality) -> File Receiver Adapter. Or do you Need anything else on Information?

BR, EF