Skip to Content
avatar image
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Nov 02, 2007 at 11:03 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 02, 2007 at 10:24 AM
    • Former Member Former Member

      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

  • avatar image
    Former Member
    Nov 02, 2007 at 10:30 AM

    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-91c40ee56c0b

    regards

    Ramesh P

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 02, 2007 at 11:08 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 02, 2007 at 11:09 AM

    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

    Add comment
    10|10000 characters needed characters exceeded