Skip to Content

How to split payload and attachment in SAP PI?

Dear Experts ,

My scenario is SOAP sender to Two SFTP Receivers.

I am using SOAP UI tool one XML payload and one attachment (it can any attachment PDF ,image.)

1) SOAP sender

2) Two target SFTP Server .

In SFTP server it can differentiate one XML payload goes to one target folder and another attachment is goes to one another target folder.

Now i am getting both in one folder with XML and attachment .

Note:-- i want to split the attachment and payload with two different folder in SFTP server .

How I achieve it.

Java Mapping was suggested by few people. Would like to know how to split the XML file and Attachment.

Please do needful ASAP

Best Regards,

Ashok.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Apr 21, 2017 at 12:23 PM

    Ashok,

    Create 2 SFTP channels :

    1.Channel1 Dont check "Keep Attachments " in this case you will get only xml file.

    2.Channel 2 Dont check "Keep Attachments " use payload swap bean and in this case you will have the attachment.

    Br,

    Manoj

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 24, 2017 at 06:43 AM

    Hi Ashok!

    As per SAP help on PayloadSwapBean:

    Add Parameters in the Module Configuration
    3. To ensure that the attachment that is to replace the application payload can be found, you must specify a parameter from the MIME header. Under Parameter Name, enter swap.keyName.
    4. Under Parameter Value, enter a payload attribute such as payload-name or payload-description, or an attribute from the MIME header such as content-type or content-description.
    5. Under Parameter Name, enter swap.keyValue.
    6. Under Parameter Value, enter the value that the attribute is to have. The MIME headers of the payloads are searched in order and the system takes the first payload that meets the criteria. This payload is swapped with the application payload.

    https://help.sap.com/saphelp_nwpi711/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/content.htm

    For example:

    swap.keyName = Content-Disposition
    swap.keyValue = attachment;filename="file_name.ext"

    swap.keyName = Content-Description
    swap.keyValue = Attachment-1

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded