cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Convert binary data (TIFF image) into XML - how ?

Former Member
0 Likes
1,519

Hi,

I have the following requirement:

1. A document is scanned and a TIFF image is saved in a directory

2. The File adapter picks up the image file and sends into XI

3. The binary data is converted into XML so a Web Service can be called (this web service will store the image in a database application)

<b>The part I am struggling with is the convert of the incoming binary data into a XML format document which will allow the Web Service to be called.</b>

Graphical mapping cannot be used therefore I am left with 3 options:

1. XSLT mapping

2. Java mapping

3. ABAP mapping

Can anyone suggest the best option to use in these circumstances and provide some sample snippet of code on how to do it.

I am alright at XSLT mapping but this is beyond me and Java mapping is completely new to me as I have very limited Java knowledge.

Thanks for your help

Colin.

View Entire Topic
stefan_grube
Active Contributor
0 Likes

The question is: How would the webservice expect the file?

An option is using base64 encoding. See this blog for an example:

/people/sap.user72/blog/2005/07/15/copy-a-file-with-same-filename-using-xi

Instead of using an adapter modile, you can use Java or ABAP Mapping for the conversion. The webservice needs to decode the base64.

Another option is sending the file as an attachment. Here you can use the functionality of sending several files from file adapter. You have to apply an XML as main payload and the TIFF as attachment. Then you need not do anything special in mapping.

Regards

Stefan