ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Binary data in XML

Post new topic  Reply to topic
 Binary data in XML « View previous topic :: View next topic » 
Author Message
DanielSonFocus
PostPosted: Wed Aug 03, 2005 7:01 am    Post subject: Binary data in XML Reply with quote

Apprentice

Joined: 05 Jun 2005
Posts: 35
Location: Louisville, Kentucky

Hi,

I am sending some binary data in an XML message to be processed by a WBIMB 5 message flow. I started the design of these flows expecting well-formed XML and so im using XML as the message domain... im starting to think that im going to have to use BLOB; i'm hesitant as this requires a bit of a rewrite to my ESQL as i will literary have to attempt to cast the BLOB as CHAR and scrape for the fields im interested in all the while i have to convert the binary data fields to base64. Is there any quick fix to this problem that doesn't involve the application tier having to send the binary data in base64? i noticed that there is a base64Binary data type in the xsd definitions, but i think this is assuming that my binary data should already be in base64 format on the way in. Anyone have any solutions?
Back to top
View user's profile Send private message
fschofer
PostPosted: Wed Aug 03, 2005 7:09 am    Post subject: Reply with quote

Knight

Joined: 02 Jul 2001
Posts: 524
Location: Mainz, Germany

Hi,
have you considered using CDATA ?

http://publib.boulder.ibm.com/infocenter/wbihelp/topic/com.ibm.etools.mft.doc/ad06370_.htm?resultof=%22%43%44%41%54%41%22%20%22%63%64%61%74%61%22%20

Greetings
Frank
Back to top
View user's profile Send private message Send e-mail
DanielSonFocus
PostPosted: Wed Aug 03, 2005 7:18 am    Post subject: Reply with quote

Apprentice

Joined: 05 Jun 2005
Posts: 35
Location: Louisville, Kentucky

no dice Frank... just tried putting the tag with binary data in a CDATA section and the flow debugger throws a "Parser Exception". I put in a CDATA section with plain text and it works fine.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Aug 03, 2005 7:25 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

CDATA has to be mostly parsable by XML.

You need to, for example, base64 encode the binary data, and then put it into the tag.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
DanielSonFocus
PostPosted: Wed Aug 03, 2005 7:43 am    Post subject: Reply with quote

Apprentice

Joined: 05 Jun 2005
Posts: 35
Location: Louisville, Kentucky

i figured as much Jeff... do you think it makes more sense to push the binary to base64 conversion up to the application layer(e.g. the various apps accessing my flow) or should i read the message as BLOB and grep for the binary fields in question and do the conversion on my own. I've gotta beleive that this conversion in the flow from BLOB to base64 will reduce throughput. This flow will be hit with a high number of messages all at once at various point throughout the day. What would be the best practice?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Aug 03, 2005 7:52 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If your flow is defined as accepting XML, and the applications are not sending valid XML, then why is it your problem?

Also, it is not necessarily easy (although I think I'm forgetting something here) to base64 encode or decode within ESQL - you might have to call out to Java to do this. And in that case you may be better off writing a preprocessor program in Java that will sit between the sending apps and your broker.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
DanielSonFocus
PostPosted: Wed Aug 03, 2005 8:03 am    Post subject: Reply with quote

Apprentice

Joined: 05 Jun 2005
Posts: 35
Location: Louisville, Kentucky

thanks for the input... i think you're right, i will ask all the applications accessing my flow to base64 encode any binary data before they send it to me. In addition you're right about base64 conversion in ESQL, you'll need to call an external Java function that performs this logic. I actually am using such a function in my flow right now to encode the inputted message and attach it to the ouput for auditing purposes. Anyway.. thanks again for the input.
Back to top
View user's profile Send private message
zpat
PostPosted: Wed Aug 03, 2005 8:32 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

I recently wrote a z/OS mainframe REXX to Base64 encode data and put it on a MQ queue - I found a freeware assembler program for the encoding - if you want the details send me a PM. There are plenty of other samples for non-mainframes around of course.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Binary data in XML
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.