cancel
Showing results for 
Search instead for 
Did you mean: 

Java Multi Mapping

Former Member
0 Kudos

Hello,

I want to archive the same result as described on this wiki page: http://wiki.sdn.sap.com/wiki/display/XI/Multi-Mapping+using+Java+Mapping

So I want to produce 3 files out of one file.

The only difference is that my input file is binary (not XML), so how do I build resulting XML? How shoudl I pur binary data into XML tags?

Is that possible at all?

Thanks for your answers!

Best Regards,

Artsiom Anichenka

Accepted Solutions (0)

Answers (2)

Answers (2)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Artsiom Anichenka,

                                   What kind of binary file you are trying to read? Do you have any sample or structure details? Please could you upload the same or email me. Then only I acn suggest the method to convert it into XML. You need java mapping or adapter module to interpret the contents of the binary file and convert it to XML.After you are able to do this then using Second (or same) java mapping code you can write three files to target directory. Now the tougher thing here is the first part i.e. conversion from binary to XML. Please refer to this article for a sample java code http://wiki.sdn.sap.com/wiki/x/SQxeDw

Regards

Anupam

Former Member
0 Kudos

Anupam,

thanks for your answer!

the type of binary file is image, but putting it into XML is not really a target for me, I just want to split an image into 3 same images on target.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Artsiom Anichenka,

                      Single java mapping code can do this. You do not need to convert to an XML.

You need dummy sender interface and dummy target interface in Operation mapping. Please let me know the version of PI you are working on  and whether you are writing the file to NFS or you are using SFTP. That is sample path where you are writing the target files to.

With these details forum memebers can perhaps provide you more better solutions.

Regards

Anupam

Former Member
0 Kudos

Anupam,

it is FTP on source and NFS on target,

PI is 7.11

Please adviise how with java-mapping I can create 3 binary messages out of one.

Thanks!

anupam_ghosh2
Active Contributor
0 Kudos

Hi Artsiom Anichenka,

                                  I am unable to execute the scenario myself as our development server is giving troubles. http://scn.sap.com/thread/3196740 . This will take some time 1-2 days.

I have myself never tried this before thus need to execute the scenario myself.

Regards

Anupam 

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>How shoudl I pur binary data into XML tags?
Is that possible at all?

of course it's possible - you can use base64 to decode the binary content and put it in the XML tags easily

Regards,

Michal Krawczyk

Former Member
0 Kudos

Michal,

thanks a lot for your answer!

sorry, maybe I was not very clear with my requirements.

I have a binary file (image) on source and on target I need 3 same images placed in different folders. So I was wondering how to put that image in the Multi messages XML structure, so it will be correctly splitted into 3 on receiving adapter.

Also another question: is it possible to set different dynamic configuration for each of the messages in milti structure to set target directory individually?