cancel
Showing results for 
Search instead for 
Did you mean: 

Converting Sender File as attachment using PayloadSwapBean module

Former Member
0 Kudos

Hi Expert,

I have a scenario where I have to pick up a file from PI & send it to another PI server as an attachement using XI Adapter.

I went through SDN & found several messages describing configuration for attachement for mail & SOAP adapter.

I attached PayloadSwapBean in my sender File channel & passed keyname as Conent-Disposition & keyValue as attachment however I dont see file being converted as an attachment in SXMB_MONI. It still shows it as main payload.

Please help me on how to convert a sender file payload into attachement. I would like to keep attachment name same as file name. Let me know how we can do that. I also noticed that on receiver XI adapter (which I would be using to send data to next PI system), you can't attach modules. Let me know if there is some other standard way of achieving this requirement.

Thanks

Regards

Sushil

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

> I have a scenario where I have to pick up a file from PI & send it to another PI server as an attachement using XI Adapter.

An XI message consists of an obligatory main payload and optional multiple attachments.

So when you have just one file, you have one main payload.

Just take that file and send it to the other PI system as is and be happy

Former Member
0 Kudos

Hi Abhishek,

XI adapter supports attachment. We are already sending some data as attachment using XI adapter to another PI system.

Hi Stefan,

Let me put little more detail about requirement. Next PI system will be routing data based on file name. If I pass file as main payload, then next PI wlll be loosing the file name so can't route the data. (Again file is encrypted hence payload based routing wont be possible)

Idea was to pass the the file as attachement & assign identifier as attachment name so that next PI can route it based on name.

I was looking for some standard configuration which can meet requirement. Last option is to develope a custom module to perform meet requirement.

Regards

Sushil

stefan_grube
Active Contributor
0 Kudos

When you activate ASMA for filename, the second PI system should keep that information.

Is this not working?

Former Member
0 Kudos

Hi Stefan,

I have not tried this yet. I will try but I was just wondering if that would work bcoz for Second PI, data is coming from XI adapter so referring to ASMA properties may not return anything.

Regards

Sushil

stefan_grube
Active Contributor
0 Kudos

I have not tried this either and I have no second PI system to test this.

I assume that the XI adapter will forward the XI message unchanged. So the ASMA fields should be available in second PI system as well.

Former Member
0 Kudos

I use this on a regular basis....the ASMAs get transferred to the other PI system and you dont have to do anything for that, other than activating them on the sender channel.

Former Member
0 Kudos

Thanks Stefan & Amol.

Hi Amol,

I have simulated this scenario but I am not getting ASMA parameters in second PI system. Let me know what configuration you are using. My config is mentioned below

First PI is picking file using file sender comm chanel. ASMA in enabled.

ASMA values are available in First PI in mapping & I can use them.

Message is passed to second PI as it is using XI adapter (HTTP desitnation has been used in receiver channel config)

In Second PI, when I am referring to ASMA values in mapping, I am getting null value. (At run time when I am executing scenario, it is populating null as part of mapping output).

Let me know if something else need to be done or what is wrong.

Thanks

Sushil

Former Member
0 Kudos

Hi Sushil,

as mentioned...no specific settings are required..

we also transfer the data from one PI to other PI using XI adapter via HTTP destinations(Type : H) and with the path prefix as /sap/xi/engine?type=entry.

the ASMAs do get transferred without any explicit setting change on XI adapter that transferres message ..

- Amol

stefan_grube
Active Contributor
0 Kudos

can you see the ASMA fields in SXMB_MONI in header under dynamic cofiguration?

Former Member
0 Kudos

Hi Stefan,

No, I dont see dynamic configuration values in second PI system. I am able to see them in first system.

Hi Amol,

Do you see dynamic configuration in second PI? I am still referring ASMA in second PI system as file parameters? Should it be HTTP header? (How are you referring ASMA in second PI). Below is my code which give me null at run time.

DynamicConfiguration dCon =(DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey dKey = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","Directory");

String FileDirectory = dCon.get(dKey);

return FileDirectory;

stefan_grube
Active Contributor
0 Kudos

Do both PI systems have same version? Which version is it?

Former Member
0 Kudos

Hi Stefan,

Its solved. I was using XI Protocol 2.0 in receiver comm channel of first PI. changed it to XI 3.0 (Transfer hop list) & I am able to see ASMA parameters..It works.

Hi Amol,

Thanks.

Regards

Sushil

Answers (1)

Answers (1)

former_member200962
Active Contributor
0 Kudos
I also noticed that on receiver XI adapter (which I would be using to send data to next PI system), you can't attach modules.

XI Adapter also does not support attachment.....you can refer help section for more information.

Regards,

Abhishek.

stefan_grube
Active Contributor
0 Kudos

> XI Adapter also does not support attachment

Abhishek, you disappoint me