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 » Generate file from BASE64encoded payload

Post new topic  Reply to topic
 Generate file from BASE64encoded payload « View previous topic :: View next topic » 
Author Message
ata_nitjsr
PostPosted: Mon Oct 23, 2017 9:15 am    Post subject: Generate file from BASE64encoded payload Reply with quote

Acolyte

Joined: 08 Apr 2007
Posts: 56

I have base64 encoded message of a pdf file. I need to generate the pdf file.
Following is the code I am using:

Code:

SET BLOB_Payload= BASE64DECODE(refBO.*:payLoad);
CREATE FIELD OutputRoot.Properties.ContentType TYPE NameValue VALUE 'application/xop+xml; charset=UTF-8; type="text/xml"';
SET OutputRoot.DFDL.UPLOADDELETE.record.field1=CAST(BLOB_Payload AS CHARACTER CCSID 819 ENCODING 546);


CCSID 1208 is throwing cast error.

The txt file is generating fine but complex file like pdf or image file are getting corrupted.
Please let me know where I am missing
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Oct 23, 2017 10:03 am    Post subject: Re: Generate file from BASE64encoded payload Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

ata_nitjsr wrote:
CCSID 1208 is throwing cast error.


So to be clear, the CAST statement fails when you use 1208 rather than 819? What is the exact text of the error?

ata_nitjsr wrote:
The txt file is generating fine but complex file like pdf or image file are getting corrupted.


How have you determined that?

ata_nitjsr wrote:
Please let me know where I am missing


I don't see where in the code you use something other than "text/xml" for PDFs and image files. Like the correct type for those data classes.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
ata_nitjsr
PostPosted: Mon Oct 23, 2017 11:21 am    Post subject: Resolved:Generate file from BASE64encoded payload Reply with quote

Acolyte

Joined: 08 Apr 2007
Posts: 56

The issue is resolved:

Code:

      SET BLOB_Payload                               = BASE64DECODE(refBO.*:payLoad);
      SET OutputRoot.BLOB.BLOB                         = BLOB_Payload;

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 » Generate file from BASE64encoded payload
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.