Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Blobs in xml

Avatar

Avatar
Level 2
Sentah
Level 2

Likes

0 likes

Total Posts

29 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
Sentah
Level 2

Likes

0 likes

Total Posts

29 posts

Correct Reply

0 solutions
View profile
Sentah
Level 2

26-08-2008

Hi,

Has anyone handled BLOB/image types in process workflow. I have a scenario where I extract the data(blob) from database and return the same as an xml output to the caller. Do i have to handle the blob return type specially while trying to embed in the xml? I know we have to convert the blob to a binary stream. Has anyone done it before ?


for .e.g my xml doesn't reflect the real value when retrieved from the database.



Dummy Sketch
oracle.sql.BLOB@ac7a58

Replies

Avatar

Avatar
Boost 5
Level 9
HowardTreisman
Level 9

Likes

5 likes

Total Posts

936 posts

Correct Reply

9 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile

Avatar
Boost 5
Level 9
HowardTreisman
Level 9

Likes

5 likes

Total Posts

936 posts

Correct Reply

9 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile
HowardTreisman
Level 9

27-08-2008

Hi Senthil

Blobs are usually stored in XML in some sort of encoded format, usually Base64.

We have a component for base64 encoding and decoding. I'm not sure off the top of my head whether our SQL component handles blob types in the database. If you'd like to verify, please email support-at-avoka.com, and they'll get you an answer...

Howard

http://www.avoka.com

Avatar

Avatar
Level 2
Sentah
Level 2

Likes

0 likes

Total Posts

29 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
Sentah
Level 2

Likes

0 likes

Total Posts

29 posts

Correct Reply

0 solutions
View profile
Sentah
Level 2

27-08-2008

I was able to solve this using a custom component and would be glad to know any alternative approaches.



-Read the image as a blob

-encode it into base64 using apache commons base64 (org.apache.commons.codec.binary.Base64) into a byte array (there is just 1 trick here , i think its specific to oracle db)

-create a new string out of byte array and return the same.



For decoding its the reverse process



-Read the encoded string

-decode it using Base64.decodeBase64(bytearray)

-create a new blob or a file

-insert into db

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

27-08-2008

In version 8.2 there is a base64 encoding exposed in the document extension for xpath.

Avatar

Avatar
Boost 5
Level 9
HowardTreisman
Level 9

Likes

5 likes

Total Posts

936 posts

Correct Reply

9 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile

Avatar
Boost 5
Level 9
HowardTreisman
Level 9

Likes

5 likes

Total Posts

936 posts

Correct Reply

9 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile
HowardTreisman
Level 9

27-08-2008

Cool!

Avatar

Avatar
Level 2
Sentah
Level 2

Likes

0 likes

Total Posts

29 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
Sentah
Level 2

Likes

0 likes

Total Posts

29 posts

Correct Reply

0 solutions
View profile
Sentah
Level 2

28-08-2008

Hi Paul,



Thanks for the update, I did try the option and it always returned an empty xml indicating that it was unable to convert it to a base64 format.



I am just trying to understand how to use the base64 encoding on the returned blob object from an underlying sql query. Is there anyway we can do it just on the blob object alone and not on every field ?

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

28-08-2008

In 8.2 it is applied to a document variable so to answer your question ...No.