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 » Converting XMLNSC string to base64Binary

Post new topic  Reply to topic
 Converting XMLNSC string to base64Binary « View previous topic :: View next topic » 
Author Message
pottas
PostPosted: Wed Jun 18, 2008 6:52 am    Post subject: Converting XMLNSC string to base64Binary Reply with quote

Disciple

Joined: 27 Oct 2005
Posts: 185
Location: South Africa

Guys,
I am running WMB 6.1.
I need to cast an XMLNSC input message to base64Binary.

I have tried the ESQL (quoted below) that's in the broker help files, but it returns the exact BLOB string back to me... ('0102030405060708090A0B0C0D0E0F').
Code:

DECLARE Base64Data BLOB '0102030405060708090A0B0C0D0E0F';
-- Add in the base64Binary field type
DECLARE base64FieldType INTEGER XMLNSC.Field + XMLNSC.base64Binary;
CREATE LASTCHILD OF OutputRoot DOMAIN 'XMLNSC' NAME 'XMLNSC';
CREATE LASTCHILD OF OutputRoot.XMLNSC TYPE base64FieldType NAME 'myBinaryData' VALUE Base64Data;


...so I need to get the ESQL to convert from either a BLOB to base64Binary, or from the InputRoot.XMLNSC straight to base64Binary.

Thanks.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jun 18, 2008 8:22 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I have tried the ESQL (quoted below) that's in the broker help files, but it returns the exact BLOB string back to me
That's the correct behaviour. The code which you are using is changing the field type of 'myBinaryData'. It is not changing the value.
However when the message hits an output node, that logical value will be converted to base64, and will appear as a base64 string in the output XML.

Other users have been confused by this, so I'll try to get that topic updated.
Back to top
View user's profile Send private message
chrisc
PostPosted: Sun Jun 22, 2008 8:27 pm    Post subject: Reply with quote

Voyager

Joined: 19 Mar 2006
Posts: 77

Just in case you're unsure why the value didn't change (and sorry if this is stating the obvious) - a BLOB string is base64 encoded. That's why the result you're seeing is exactly the same as what you passed in.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Jun 23, 2008 12:38 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

chrisc said:
Quote:
a BLOB string is base64 encoded

That's just plain wrong. When you say 'a BLOB string' I presume you are talking about a string representation of some bytes. You can convert a string of bytes to a string of characters in any number of ways. In message broker, if you CAST a BLOB to a string, you will get something which looks like xs:hexBinary. That is what pottas was seeing. base64Binary is a different, slightly more efficient encoding.
Back to top
View user's profile Send private message
pottas
PostPosted: Mon Jun 23, 2008 4:31 am    Post subject: Reply with quote

Disciple

Joined: 27 Oct 2005
Posts: 185
Location: South Africa

kimbert,
Thanks - makes sense what you said - I tested it by putting the Msg to a queue and it really did change the data to base64 format. Quite nifty!

pottas
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Jun 23, 2008 5:01 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Good - I'm glad somebody has found a use for that.
The topic update has been processed, so it will appear in the online docs at some point in the future.
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 » Converting XMLNSC string to base64Binary
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.