|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
base64binary conversion problem |
« View previous topic :: View next topic » |
Author |
Message
|
vinod_sri |
Posted: Tue Aug 28, 2007 8:00 am Post subject: base64binary conversion problem |
|
|
Apprentice
Joined: 10 Dec 2003 Posts: 42 Location: Atlanta
|
Hello Folks,
I have a problem converting a part of the incoming message from base64 to binary. The message is in TDS format defined in MRM domain. One of the options that I had tried are, I took the whole message as BLOB and converted into CHARACTER in the following manner
MqInput (Domain as BLOB) ----> Compute Node ----> MQOutput
the ESQL in the compute node written as
DECLARE cMessage CHARACTER;
SET cMessage = CAST(InputRoot.BLOB.BLOB AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding);
CALL CopyMessageHeaders();
SET OutputRoot.XML.cMessage = cMessage;
PROPAGATE TO TERMINAL 0;
The result is an error saying, "Message Contain no data". It is not propagating anything to the Output queue.
Then, I was advised to use base64binary conversion. I have no clue how to use it. I have no idea how to code this. Do I need to use Java compute node to do this, or can I do it with ESQL code.
My incoming message looks like
MDWSSC1.153161804911017402221DSM014PNQ2007-06-04 17:45:09DSM014PNQ2007-06-04 17:45:08PG5vYnI+VEFTSyBOT1RFIFBST0ZJTEU6PC9ub2JyPg0KJnF1b3Q7UkVCIG11c3QgYWx3YXlzIGJlIHVwZGF0ZWQgaW4gUktEUyBhczogDQpQQVlBVCA9IEJPMg0KUHJpbnQgRnJ0IGxpbmUgPSZSBhcyBwcmludCA9IE4mcXVvdDsNCihQUkogUkVGOiBJTkRJQSBHRU5FUkFMIDExMDQwNyk8SFI+
But, following piece of message is coming in base64 format.
PG5vYnI+VEFTSyBOT1RFIFBST0ZJTEU6PC9ub2JyPg0KJnF1b3Q7UkVCIG11c3QgYWx3YXlzIGJlIHVwZGF0ZWQgaW4gUktEUyBhczogDQpQQVlBVCA9IEJPMg0KUHJpbnQgRnJ0IGxpbmUgPSZSBhcyBwcmludCA9IE4mcXVvdDsNCihQUkogUkVGOiBJTkRJQSBHRU5FUkFMIDExMDQwNyk8SFI+
Please give me an idea or solution for converting the base64 to binary. Please also provide me the code sample to understand the conversion. I really appreciate your help.
Thanks
Vinod. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Aug 28, 2007 1:31 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Please give me an idea or solution for converting the base64 to binary |
Use Java. The MRM domain can do automatic base64 decoding, but only when you are parsing XML data.
There are well-known Java libraries available for base64 encoding/decoding. Five minutes with a browser and a search engine should find them. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Aug 28, 2007 2:59 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If you search around you should find some ESQL code for calling static java methods on com.ibm.broker.javacompute.Base64 _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|