and the solution to this currently is to deploy a custom adapter module
Also check the ‘Set Adapter-Specific Message Attributes’ option to enable the Dynamic Configuration attributes to be available.
an additional attachment.
Parameter Name | Parameter Value |
---|---|
requiredHeaders | All |
dcNamespace |
i.e. email content, with another payload that is appended to the XI message i.e. the attachment
Parameter Name | Parameter Value |
---|---|
swap.keyName | Payload-Name |
swap.keyValue |
MailAttachment-1
|
Receiver File Channel Settings
Now in the Receiver File adapter we are going to use the DynamicConfigurationBean to retrieve the attachment name.
The attachment file name is available in the Dynamic configuration attribute Part[1].Content-Description, which we will write to the PI message interface name.
To the ‘Module’ tab add the DynamicConfigurationBean with the following parameters:
Parameter Name | Parameter Value |
---|---|
key.0 |
write http://sap.com/xi/XI/System/Mail Part[1].Content-Description |
value.0 |
message.interface |
Pic 2.1
Using Variable Substitution, create a variable fname referencing the message interface name and access this variable in the file name field.
Pic 2.2
Pic 2.3
Testing
The configurations are complete. It’s time to test our scenario.
A sample mail is sent to the mail account which the sender email adapter is polling with the attachment name MyAttachment1.CSV
Pic 3.1
Integrated configuration was used in this scenario, so we can see the Dynamic Configuration message attributes in message monitoring.
Note that Part[1].Content-Description has been set to MyAttachment1.CSV at runtime.
Pic 3.2
The payload was swapped successfully and the attachment data has been set to the main payload as shown below.
Pic 3.3
We can see the output file in the output folder path with the same name as our attachment MyAttachment1.CSV.
Nice Blog sivasakthi. Got to learn few things about mail adapter with attachments.
Thanks for sharing:)
Nice Blog Shakku 🙂 – Kulwinder
Thnx 🙂
Hi Sivasakthi,
Is it possible to pick the .PDF files from Emails and place them on FTP server with the same file name?
thanks-
Ramesh
Good one.
Hi Sivasakthi,
I am working on a file to mail scenario in which i have to send the files as attachment with the same name of the source file i am sending…but, the received mails are not having the same names for the attachments..My requirement is to set these names to the attachments dynamically..I am a fresher to PI..can you please help me to resolve my issue
Nice blog siva
One clarification:
If it is FTP folder instead of NFS any specific change need to do or only the adapter selection is enough.
Hi Siva,
thank you for letting us the standard beans for mail attachement.
Keep blogging 🙂
Regards,
Mastan
Nice Blog 🙂
Very well explained… I like the use of MultiPartHeaderBean …
–Divyesh
Hi Sivasakthi,
Your blog helpmed me a lot in creating the same with SOAP attachments.
Everything worked fine, except the file name generation. In dynamic configuration the file name is coming as <filename.ext>. As ‘<‘ and ‘>’ are not permitted in creation of file name, PI is generating it with underscores (_filename.ext_).
I rectified this issue by using an UDF. But just want to know is there any other way to get the correct file name in adapter level.
Regards,
Deepak Ravi
Hello!
I tried to implement this, but it always fails with this 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”
Hi,
I’ve also tried to implement this with your description, but get always the error:
“write property message.interface from key (http://sap.com/xi/XI/System/Mail)Part[1].Content-Description with value null; “
Do you know the reason why the message doesn’t create the tag “Content-description?”
Hi Ahmet,
Did you find any solution for the issue? I am actually facing the same issue even in my case too 🙁
Kindly let me know if you have any resolution please?
Ta,Lova