Author |
Message
|
wraymore |
Posted: Mon Mar 03, 2008 8:03 am Post subject: Help with converting base64 encoded string from VB6 |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
WMB 6.0.0.3 on AIX 5.3
Message coming into broker from a queue that is populated by a Web Service that gets input from a VB6 application.
My message flow has successfully decoded the base64 string into a BLOB; however when I write this BLOB as a message to a queue for a down line server to process the data is still UTF-16(unicode; two-byte). How can I convert the character code set of the data to 819.
I have tried CAST(... AS BLOB CCSID OutputRoot.MQMD.CodedCharSetId) which 819, also MQRFH2.CodedCharSetId and MQRFH2.NameValueCCSID to no avail.
 |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Mar 03, 2008 12:35 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20763 Location: LI,NY
|
First you must cast the Blob as char giving it the correct char set for the incomming blob.
Then you can cast the char to a blob for the output giving the target CCSID.
You might want to set the target CCSID on OutputRoot.Properties and the MQRFH2.CodedCharSetId.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
broker_new |
Posted: Mon Apr 21, 2008 6:08 pm Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
hey wraymore can you post the code how to post using the base64 encoding _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
wraymore |
Posted: Tue Apr 22, 2008 12:32 pm Post subject: |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
Here is a snippet of code from my flow:
DECLARE DataAsBase64 CHARACTER;
DECLARE DataAsBLOB BLOB;
SET DataAsBLOB = CAST(FINALHEADER AS BLOB CCSID 1208);
SET DataAsBase64 = base64Encode(DataAsBLOB);
...
CREATE PROCEDURE base64Encode(IN source BLOB)RETURNS CHARACTER LANGUAGE JAVA
EXTERNAL NAME "com.ibm.broker.javacompute.Base64.encode";
This is taking a data string; casting as BLOB; and then envoking the built in javacompute.Base64 method.
To decode you just need to do the opposite operations. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Apr 22, 2008 4:11 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5543 Location: Southampton
|
Note that XMLNSC has base64 support in v6.1 |
|
Back to top |
|
 |
|