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,513

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.

Accepted Solutions (1)

Accepted Solutions (1)

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

Answers (4)

Answers (4)

Former Member
0 Likes

Hi Colin,

can you process attachments in ur target WS?

If yes, you don't need to convert it to XML, just send the file as attachment..

Peter

Former Member
0 Likes

Colin

I think this maybe do-able using XSLT.

There is a similar function within Stylus Studio which may help convert other formats to XML.

http://www.stylusstudio.com/convert_to_xml.html

http://www.stylusstudio.com/binary_xml.html

Former Member
0 Likes

hi colin,

it can be achieved using java mapping

refer this pdf

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee5...

regards

Ramesh P

Former Member
0 Likes

Hi Colin

Look for the below link

https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/l...

<b>***Reward point if helpfull</b>

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b</a>

Former Member
0 Likes

Hi,

This does not describe what I want to do. This explains how to process and image file and convert it to another format - for example BMP to TIFF.

This does not explain how to convert the binary data into XML - which is what I need.

Kind regards

Colin.

Former Member
0 Likes

Colin,

I dont think standard adapters can be used for this requirement. Conversion Agent or other such tools may help you out here. But I dont have any experience with these tools

Regards,

Jai Shankar